|
| 1 | +FROM php:8.3-fpm |
| 2 | + |
| 3 | +LABEL org.opencontainers.image.authors= "Alexandre Jardin <[email protected]>" |
| 4 | +LABEL org.opencontainers.image.title="Custom PHP 8.3 image for an application supported by Origami." |
| 5 | +LABEL org.opencontainers.image.description="https://github.com/origamiphp/docker-images/blob/main/php/README.md" |
| 6 | +LABEL org.opencontainers.image.source="https://github.com/origamiphp/docker-images/blob/main/php/8.3/Dockerfile" |
| 7 | + |
| 8 | +# Installs the system requirements |
| 9 | +RUN \ |
| 10 | + apt update && \ |
| 11 | + apt install -y --no-install-recommends \ |
| 12 | + git \ |
| 13 | + jq \ |
| 14 | + libc-client-dev \ |
| 15 | + libfreetype-dev \ |
| 16 | + libicu-dev \ |
| 17 | + libkrb5-dev \ |
| 18 | + libjpeg-dev \ |
| 19 | + libpng-dev \ |
| 20 | + libpq-dev \ |
| 21 | + libssh2-1-dev \ |
| 22 | + libtidy-dev \ |
| 23 | + libwebp-dev \ |
| 24 | + libxml2-dev \ |
| 25 | + libxml2-utils \ |
| 26 | + libxslt-dev \ |
| 27 | + libzip-dev \ |
| 28 | + nano \ |
| 29 | + procps \ |
| 30 | + ssh-client \ |
| 31 | + ssmtp \ |
| 32 | + unzip |
| 33 | + |
| 34 | +# Installs the PHP extensions |
| 35 | +RUN \ |
| 36 | + docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \ |
| 37 | + docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \ |
| 38 | + docker-php-ext-install -j$(nproc) \ |
| 39 | + bcmath \ |
| 40 | + exif \ |
| 41 | + imap \ |
| 42 | + intl \ |
| 43 | + gd \ |
| 44 | + opcache \ |
| 45 | + pcntl \ |
| 46 | + pdo_mysql \ |
| 47 | + pdo_pgsql \ |
| 48 | + soap \ |
| 49 | + sockets \ |
| 50 | + tidy \ |
| 51 | + xsl \ |
| 52 | + zip && \ |
| 53 | + yes "" | pecl install apcu redis ssh2-beta && \ |
| 54 | + docker-php-ext-enable apcu redis ssh2 && \ |
| 55 | + perl -pi -e "s|;pm.status_path = /status|pm.status_path = /php_fpm_status|g" /usr/local/etc/php-fpm.d/www.conf && \ |
| 56 | + perl -pi -e "s/mailhub=mail/mailhub=maildev/" /etc/ssmtp/ssmtp.conf |
| 57 | + |
| 58 | +# Installs the JavaScript dependencies |
| 59 | +RUN \ |
| 60 | + curl -fsSL https://deb.nodesource.com/setup_17.x | bash - && \ |
| 61 | + apt install -y --no-install-recommends nodejs && \ |
| 62 | + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ |
| 63 | + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ |
| 64 | + apt update && \ |
| 65 | + apt install -y --no-install-recommends yarn && \ |
| 66 | + yarn global add grunt-cli gulp |
| 67 | + |
| 68 | +# Assigns a new UID/GID to avoid using a generated value |
| 69 | +RUN \ |
| 70 | + usermod -u 1000 www-data && \ |
| 71 | + groupmod -g 1000 www-data |
| 72 | + |
| 73 | +# Give www-data permissions to its home folder |
| 74 | +RUN chown www-data:www-data /var/www |
| 75 | + |
| 76 | +# Installs the "netz98/n98-magerun2" package |
| 77 | +RUN \ |
| 78 | + curl -sS https://files.magerun.net/n98-magerun2.phar --output /usr/local/bin/magerun2 && \ |
| 79 | + chmod +x /usr/local/bin/magerun2 |
| 80 | + |
| 81 | +# Installs Composer globally and configures it |
| 82 | +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer |
| 83 | +ENV COMPOSER_ALLOW_SUPERUSER 1 |
| 84 | +ENV COMPOSER_MEMORY_LIMIT -1 |
| 85 | +ENV COMPOSER_HOME /.composer |
| 86 | +ENV COMPOSER_CACHE_DIR /.composer/cache |
| 87 | + |
| 88 | +# Installs the custom entrypoint |
| 89 | +COPY --from=ajardin/php-entrypoint:latest /usr/local/bin/docker-custom-entrypoint /usr/local/bin/docker-custom-entrypoint |
| 90 | +RUN chmod 777 /usr/local/bin/docker-custom-entrypoint |
| 91 | +CMD ["php-fpm"] |
| 92 | +ENTRYPOINT ["docker-custom-entrypoint"] |
0 commit comments