php-apache/Dockerfile

28 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2024-08-22 14:26:42 +02:00
# Rx3 PHP Apache Mageia-9 Docker Image
#-------------------------------------------------------------------------------
FROM docker.xor.rx3:5000/rx3/base-mga9:1.2.1
2024-08-22 14:26:42 +02:00
ARG IMG_ID
ARG IMG_NAME
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_ID}.name=${IMG_NAME}
LABEL org.rx3.${IMG_ID}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_ID}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer \
2024-08-22 14:26:42 +02:00
&& echo -e "RewriteEngine On\n<Directory /var/www/html>\n Options Includes Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n</Directory>" >/etc/httpd/conf/conf.d/rx3.conf \
&& echo -e "<?php\n phpinfo();\n phpinfo(INFO_MODULES);\n?>\n" >/var/www/html/info.php \
&& echo -e '#!/bin/bash\n\nusermod -u ${APACHE_UID} apache\ngroupmod -g ${APACHE_GID} apache\n\nchown -R apache:apache /var/log/httpd\n\nsed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" /etc/httpd/conf/httpd.conf\n\n/usr/sbin/httpd -DFOREGROUND' > /usr/local/sbin/apache_init \
&& chmod a+x /usr/local/sbin/apache_init
2024-08-22 14:26:42 +02:00
VOLUME /var/www/html
EXPOSE 80
ENTRYPOINT ["/usr/local/sbin/apache_init"]