- Add PHP PDO PostgreSQL & MySQL modules,

- Add and use APACHE_UID & APACHE_GID environement variable.
This commit is contained in:
Arnaud G. GIBERT 2024-08-24 12:57:19 +02:00
parent 535dc239a7
commit f82f70e46f
5 changed files with 31 additions and 5 deletions

6
.env
View File

@ -1,4 +1,8 @@
IMG_ID="php-apache-mga9" IMG_ID="php-apache-mga9"
IMG_NAME="Rx3 PHP Apache Mageia-9 Docker Image" IMG_NAME="Rx3 PHP Apache Mageia-9 Docker Image"
IMG_VERSION="1.0.0" IMG_VERSION="1.1.0"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>' IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
# To be configured
APACHE_UID=980
APACHE_GID=977

View File

@ -14,12 +14,14 @@ LABEL org.rx3.${IMG_ID}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER} LABEL maintainer=${IMG_MAINTAINER}
RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-phpmailer \ RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer \
&& 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 "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 "<?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\n/usr/sbin/httpd -DFOREGROUND' > /sbin/apache_init \
&& chmod a+x /sbin/apache_init
VOLUME /var/www/html VOLUME /var/www/html
EXPOSE 80 EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd", "-DFOREGROUND"] ENTRYPOINT ["/sbin/apache_init"]

View File

@ -7,7 +7,8 @@ This is project aims to build a PHP + Apache + Mageia 9 docker image used by oth
Features: Features:
- Curtently based on base-mga9:1.2.0 image, - Curtently based on base-mga9:1.2.0 image,
- PostgreSQL & MySQL ready, - PostgreSQL & MySQL ready,
- PHPMailer installed. - PHPMailer installed,
- Apache UID & GID configurable.
Enjoy it! Enjoy it!

View File

@ -1,3 +1,12 @@
------------------------------------------------------------------------------------------------------------------------------------
PHP-Apache-Mga9 V 1.1.0 - A. GIBERT - 2024/08/24
------------------------------------------------------------------------------------------------------------------------------------
- Add PHP PDO PostgreSQL & MySQL modules,
- Add and use APACHE_UID & APACHE_GID environement variable.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
PHP-Apache-Mga9 V 1.0.0 - A. GIBERT - 2024/08/22 PHP-Apache-Mga9 V 1.0.0 - A. GIBERT - 2024/08/22
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@ -2,10 +2,13 @@
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
name: ${IMG_ID} name: ${IMG_ID}
services: services:
webapp: webapp:
container_name: ${IMG_ID} container_name: ${IMG_ID}
image: docker.xor.rx3:5000/rx3/${IMG_ID}:${IMG_VERSION} image: docker.xor.rx3:5000/rx3/${IMG_ID}:${IMG_VERSION}
build: build:
context: . context: .
args: args:
@ -13,7 +16,14 @@ services:
- IMG_NAME=${IMG_NAME} - IMG_NAME=${IMG_NAME}
- IMG_VERSION=${IMG_VERSION} - IMG_VERSION=${IMG_VERSION}
- IMG_MAINTAINER=${IMG_MAINTAINER} - IMG_MAINTAINER=${IMG_MAINTAINER}
restart: unless-stopped restart: unless-stopped
environment:
APACHE_UID: ${APACHE_UID}
APACHE_GID: ${APACHE_GID}
network_mode: bridge network_mode: bridge
ports: ports:
- "127.0.0.1:8080:80" - "127.0.0.1:8080:80"