Sign inSign up

bhojkamal/php84-nginx-alpine

By bhojkamal

•Updated 5 months ago

alpine base image - so image size half of normal base

Image
Web servers
0

437

bhojkamal/php84-nginx-alpine repository overview

⁠Use official PHP-FPM Alpine as base

FROM php:8.4-fpm-alpine

⁠Install runtime libs + system tools

RUN apk add --no-cache
nginx
supervisor
bash
curl
zip
unzip
git
libpng
libjpeg-turbo
libwebp
freetype
icu
libxml2
libxslt
libzip
postgresql-libs
oniguruma
openssl
libsodium

⁠Install build-time deps, compile PHP extensions, then remove build deps

RUN apk add --no-cache --virtual .build-deps
build-base
autoconf
libpng-dev
libjpeg-turbo-dev
libwebp-dev
freetype-dev
icu-dev
libxml2-dev
libxslt-dev
libzip-dev
postgresql-dev
oniguruma-dev
openssl-dev
libsodium-dev
&& docker-php-ext-configure gd
--with-freetype
--with-jpeg
--with-webp
&& docker-php-ext-install
pdo
pdo_pgsql
pgsql
mbstring
exif
pcntl
bcmath
intl
xsl
opcache
zip
gd
sodium
&& apk del .build-deps
&& rm -rf /var/cache/apk/* /tmp/*

⁠OPcache + JIT tuning for PHP 8.4

RUN printf "opcache.enable=1\n
opcache.jit=tracing\n
opcache.jit_buffer_size=128M\n
opcache.memory_consumption=256\n
opcache.max_accelerated_files=20000\n
opcache.validate_timestamps=0\n" > /usr/local/etc/php/conf.d/opcache.ini

⁠Install Composer globally (pinned for reproducibility)

COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3
CMD curl -f http://localhost/ping⁠ || exit 1

Tag summary

Content type

Image

Digest

sha256:a0b46538b…

Size

64.3 MB

Last updated

5 months ago

docker pull bhojkamal/php84-nginx-alpine