Skip to content

Commit

Permalink
fixed gd image not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
azonedev authored Jun 21, 2023
1 parent 94ee9a7 commit 762b867
Showing 1 changed file with 36 additions and 32 deletions.
68 changes: 36 additions & 32 deletions .docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@ FROM php:8.1-fpm-alpine

ARG SERVER_ENVIRONMENT

# Add Repositories
RUN rm -f /etc/apk/repositories &&\
echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/main" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/community" >> /etc/apk/repositories

# fix work iconv library with alpine
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

# Add Build Dependencies
RUN apk update && apk add --no-cache \
RUN set -ex \
&& apk --no-cache add \
postgresql-dev \
libzip-dev \
libmcrypt-dev \
libjpeg-turbo-dev \
Expand All @@ -36,42 +28,54 @@ RUN apk update && apk add --no-cache \
vim \
openssl-dev \
pcre-dev \
pcre2-dev
pcre2-dev \
libxslt-dev \
libffi-dev \
gcc \
g++ \
make \
autoconf \
libgcc \
libstdc++ \
file \
xz \
mariadb-dev


RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
RUN docker-php-ext-configure imap
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp

# Configure & Install Extension
RUN docker-php-ext-configure \
opcache --enable-opcache &&\
docker-php-ext-configure zip && \
docker-php-ext-install -j "$(nproc)" \
# Configure & Install Extensions
RUN docker-php-ext-install -j "$(nproc)" \
opcache \
pdo \
pdo_mysql

RUN CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install sockets
pdo_pgsql \
pgsql \
pdo_mysql \
gd \
zip \
imap \
intl \
bz2 \
soap \
bcmath \
sockets \
xsl \
ffi

RUN apk add --update --no-cache autoconf g++ make \
&& pecl install redis \
&& docker-php-ext-enable redis
# Install Redis
RUN pecl install redis && docker-php-ext-enable redis

#RUN pecl install openswoole-4.9.1 && docker-php-ext-enable openswoole
# Add Composer
RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/bin/ --filename=composer
#RUN composer install --no-interaction --optimize-autoloader --no-dev --prefer-dist
php -- --install-dir=/usr/bin/ --filename=composer

COPY .docker/app/opcache.ini $PHP_INI_DIR/conf.d/
COPY .docker/app/php.ini $PHP_INI_DIR/conf.d/

# Remove Build Dependencies
#RUN apk del -f .build-deps

# Setup Working Dir
WORKDIR /var/www/app

COPY .docker/app/init.sh /usr/local/bin
RUN chmod +x /usr/local/bin/init.sh

ENTRYPOINT [ "/usr/local/bin/init.sh" ]
ENTRYPOINT ["/usr/local/bin/init.sh"]

0 comments on commit 762b867

Please sign in to comment.