Files
php-apache/Dockerfile
T

27 lines
1.3 KiB
Docker
Raw Normal View History

FROM archlinux:latest
2025-10-09 21:16:58 +02:00
RUN pacman -Syu --noconfirm apache php-apache php php-gd php-pgsql \
2025-10-26 13:45:57 +01:00
&& pacman -Sc --noconfirm \
&& rm -v /var/log/pacman.log /var/lib/pacman/sync/*
2025-10-09 21:16:58 +02:00
2025-10-26 13:45:57 +01:00
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 \
2025-10-27 18:43:28 +01:00
&& 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 \
2025-10-26 13:45:57 +01:00
&& 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
2025-10-09 21:16:58 +02:00
COPY opcache.ini /etc/php/conf.d/opcache.ini
ENTRYPOINT ["httpd", "-DFOREGROUND"]