|
| 1 | +FROM php:8.5-fpm-trixie |
| 2 | + |
| 3 | +# Install dependencies and PHP extensions. |
| 4 | +COPY ./apt /etc/apt |
| 5 | +RUN set -x \ |
| 6 | + # Setup the nginx debian repo. |
| 7 | + && VERSION_CODENAME="$(awk -F= '/^VERSION_CODENAME=/ { print $2 }' /etc/os-release)" \ |
| 8 | + && echo "deb [signed-by=/etc/apt/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian $VERSION_CODENAME nginx" > /etc/apt/sources.list.d/nginx.list \ |
| 9 | + # Symlink supervisord config. |
| 10 | + && ln -s /usr/local/etc/supervisord.conf /etc/ \ |
| 11 | + # Web-writable state directory and nginx listener directory. |
| 12 | + && install -d -o www-data -g www-data /run/www /run/listen \ |
| 13 | + # Empty default crontab. |
| 14 | + && touch /etc/crontab \ |
| 15 | + # Run-time dependencies. |
| 16 | + && apt-get update \ |
| 17 | + && apt-get install -y --no-install-recommends \ |
| 18 | + libgd3 \ |
| 19 | + libgmpxx4ldbl \ |
| 20 | + libmemcached11 \ |
| 21 | + libmemcachedutil2 \ |
| 22 | + libpq5 \ |
| 23 | + libzip5 \ |
| 24 | + nginx \ |
| 25 | + tini \ |
| 26 | + unzip \ |
| 27 | + zlib1g \ |
| 28 | + supervisor \ |
| 29 | + jq \ |
| 30 | + pwgen \ |
| 31 | + default-mysql-client \ |
| 32 | + vim \ |
| 33 | + && savedAptMark="$(apt-mark showmanual)" \ |
| 34 | + # Build-time dependencies. |
| 35 | + && apt-get install -y --no-install-recommends \ |
| 36 | + icu-devtools \ |
| 37 | + libgd-dev \ |
| 38 | + libgmp-dev \ |
| 39 | + libicu-dev \ |
| 40 | + libldap2-dev \ |
| 41 | + libmemcached-dev \ |
| 42 | + libonig-dev \ |
| 43 | + libpq-dev \ |
| 44 | + libsqlite3-dev \ |
| 45 | + libzip-dev \ |
| 46 | + zlib1g-dev \ |
| 47 | + # Build PHP extensions. |
| 48 | + && docker-php-ext-configure gd \ |
| 49 | + --with-external-gd \ |
| 50 | + && docker-php-ext-configure zip \ |
| 51 | + --with-zip \ |
| 52 | + && docker-php-ext-configure pdo_mysql \ |
| 53 | + && docker-php-ext-install \ |
| 54 | + exif \ |
| 55 | + gd \ |
| 56 | + gettext \ |
| 57 | + gmp \ |
| 58 | + intl \ |
| 59 | + ldap \ |
| 60 | + mbstring \ |
| 61 | + pcntl \ |
| 62 | + pdo_mysql \ |
| 63 | + pdo_pgsql \ |
| 64 | + pdo_sqlite \ |
| 65 | + zip \ |
| 66 | + && pecl install \ |
| 67 | + memcached \ |
| 68 | + redis \ |
| 69 | + && docker-php-ext-enable \ |
| 70 | + memcached \ |
| 71 | + redis \ |
| 72 | + # Cleanup. |
| 73 | + && apt-mark auto '.*' > /dev/null \ |
| 74 | + && apt-mark manual $savedAptMark > /dev/null \ |
| 75 | + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ |
| 76 | + && rm -r \ |
| 77 | + /var/lib/apt/lists/* \ |
| 78 | + /tmp/pear \ |
| 79 | + # Remove PHP FPM config, because we'll replace it. |
| 80 | + && rm -fr /usr/local/etc/php-fpm.* \ |
| 81 | + # Ensure nginx directories are writable. |
| 82 | + && rm -fr /var/log/nginx /var/cache/nginx \ |
| 83 | + && install -d -o www-data -g www-data /var/log/nginx /var/cache/nginx |
| 84 | + |
| 85 | +# Copy MinIO client. |
| 86 | +COPY --from=minio/mc:latest /usr/bin/mc /usr/bin/mc |
| 87 | + |
| 88 | +# Copy pocketcron. |
| 89 | +COPY --from=ghcr.io/stephank/pocketcron /usr/bin/pocketcron /usr/bin/pocketcron |
| 90 | + |
| 91 | +# Copy configuration files and scripts. |
| 92 | +COPY usrlocal/ /usr/local/ |
| 93 | +COPY nginx/ /etc/nginx/ |
| 94 | + |
| 95 | +# Image configuration. |
| 96 | +ENTRYPOINT ["/usr/bin/tini", "--"] |
| 97 | +CMD ["supervisord"] |
0 commit comments