saltstack-magento-example/salt/srv/salt/base/php-fpm-docker/files/Dockerfile

154 lines
2.7 KiB
Docker

FROM php:8.1-fpm
ARG APP_ROOT=/app
ENV PHP_VALIDATE_TIMESTAMPS 1
ENV DEBUG false
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl
# Install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
apt-utils \
sendmail-bin \
sendmail \
sudo \
iproute2 \
git \
gnupg2 \
ca-certificates \
lsb-release \
software-properties-common \
libbz2-dev \
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
libgmp-dev \
libgpgme11-dev \
libicu-dev \
libldap2-dev \
libpcre3-dev \
libpspell-dev \
libtidy-dev \
libxslt1-dev \
libyaml-dev \
libzip-dev \
zip \
unzip \
acl \
cron \
curl \
wget \
libaudit1 \
libbrotli1 \
libbsd0 \
libbz2-1.0 \
libcap-ng0 \
libcom-err2 \
libcrypt1 \
libcurl4 \
libexpat1 \
libffi7 \
libfftw3-double3 \
libfontconfig1 \
libfreetype6 \
libgcc-s1 \
libgcrypt20 \
libglib2.0-0 \
libgmp10 \
libgnutls30 \
libgomp1 \
libgpg-error0 \
libgssapi-krb5-2 \
libhogweed6 \
libicu67 \
libidn2-0 \
libjpeg62-turbo \
libk5crypto3 \
libkeyutils1 \
libkrb5-3 \
libkrb5support0 \
liblcms2-2 \
libldap-2.4-2 \
liblqr-1-0 \
libltdl7 \
liblzma5 \
libmagickcore-6.q16-6 \
libmagickwand-6.q16-6 \
libmd0 \
libmemcached11 \
libncurses6 \
libnettle8 \
libnghttp2-14 \
libonig5 \
libp11-kit0 \
libpam0g \
libpcre2-8-0 \
libpcre3 \
libz-dev \
libmemcached-dev \
libmemcached-tools \
&& rm -rf /var/lib/apt/lists/*
# Configure the gd library
RUN docker-php-ext-configure \
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-configure \
opcache --enable-opcache
# Install required PHP extensions
RUN docker-php-ext-install -j$(nproc) \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
gmp \
intl \
mysqli \
opcache \
pdo_mysql \
pspell \
shmop \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
xsl \
zip \
pcntl
RUN pecl install -o -f \
gnupg \
mailparse \
msgpack \
oauth \
pcov \
raphf \
redis \
xdebug-3.1.5 \
xmlrpc-1.0.0RC3 \
yaml \
memcached
RUN docker-php-ext-enable memcached
# Install Composer
RUN wget -O composer-setup.php https://getcomposer.org/installer
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN chmod +x /usr/local/bin/composer
RUN mkdir -p ${APP_ROOT}
# Delete default config file
RUN rm /usr/local/etc/php-fpm.d/zz-docker.conf
RUN chown -R www-data:www-data /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${APP_ROOT}
WORKDIR ${APP_ROOT}