Files
php-apache/Dockerfile
T
feedc0de b116ce8b80
Publish PHP Apache image / Build, test and push (push) Failing after 21s
New approach with helm chart and add gd and opcache
2026-09-10 20:13:16 +02:00

27 lines
1.3 KiB
Docker

FROM archlinux:latest
RUN pacman -Syu --noconfirm apache php-apache php php-gd php-pgsql \
&& pacman -Sc --noconfirm \
&& rm -v /var/log/pacman.log /var/lib/pacman/sync/*
RUN sed -i '/mod_mpm_event/ s/^/#/' /etc/httpd/conf/httpd.conf \
&& sed -i '/mod_mpm_prefork/ s/^#//' /etc/httpd/conf/httpd.conf \
&& sed -i -E 's#^(\s*CustomLog\s+)(["'\'']?)[^"'\''[:space:]]+\2#\1/dev/null#' /etc/httpd/conf/httpd.conf \
&& sed -i -E 's#^(\s*ErrorLog\s+)(["'\'']?)[^"'\''[:space:]]+\2#\1/dev/null#' /etc/httpd/conf/httpd.conf \
&& sed -i '/<Directory[[:space:]]\+"\/srv\/http">/,/<\/Directory>/ s/^\([[:space:]]*AllowOverride[[:space:]]*\)None/\1All/' /etc/httpd/conf/httpd.conf \
&& sed -i '/mod_rewrite/ s/^#//' /etc/httpd/conf/httpd.conf \
&& echo LoadModule php_module modules/libphp.so >> /etc/httpd/conf/httpd.conf \
&& echo AddHandler php-script .php >> /etc/httpd/conf/httpd.conf \
&& echo Include conf/extra/php_module.conf >> /etc/httpd/conf/httpd.conf \
&& install -d /etc/php/conf.d \
&& sed -i -e '/extension=exif/ s/^;//' \
-e '/extension=gd/ s/^;//' \
-e '/extension=intl/ s/^;//' \
-e '/extension=pgsql/ s/^;//' \
-e '/extension=pdo_pgsql/ s/^;//' \
/etc/php/php.ini
COPY opcache.ini /etc/php/conf.d/opcache.ini
ENTRYPOINT ["httpd", "-DFOREGROUND"]