From f82f70e46fe0a3a42f768e5f5f323efba34530ce Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 24 Aug 2024 12:57:19 +0200 Subject: [PATCH] - Add PHP PDO PostgreSQL & MySQL modules, - Add and use APACHE_UID & APACHE_GID environement variable. --- .env | 6 +++++- Dockerfile | 8 +++++--- ReadMe.txt | 3 ++- ReleaseNotes.txt | 9 +++++++++ compose.yaml | 10 ++++++++++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 441a5cd..e850995 100644 --- a/.env +++ b/.env @@ -1,4 +1,8 @@ IMG_ID="php-apache-mga9" IMG_NAME="Rx3 PHP Apache Mageia-9 Docker Image" -IMG_VERSION="1.0.0" +IMG_VERSION="1.1.0" IMG_MAINTAINER='"Arnaud G. GIBERT" ' + +# To be configured +APACHE_UID=980 +APACHE_GID=977 diff --git a/Dockerfile b/Dockerfile index c6033e9..06e4df6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,14 @@ 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-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\n Options Includes Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n" >/etc/httpd/conf/conf.d/rx3.conf \ - && echo -e "\n" >/var/www/html/info.php + && echo -e "\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 EXPOSE 80 -ENTRYPOINT ["/usr/sbin/httpd", "-DFOREGROUND"] +ENTRYPOINT ["/sbin/apache_init"] diff --git a/ReadMe.txt b/ReadMe.txt index ffa006a..51aea89 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -7,7 +7,8 @@ This is project aims to build a PHP + Apache + Mageia 9 docker image used by oth Features: - Curtently based on base-mga9:1.2.0 image, - PostgreSQL & MySQL ready, - - PHPMailer installed. + - PHPMailer installed, + - Apache UID & GID configurable. Enjoy it! diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 4fc7d02..1934dfa 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -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 ------------------------------------------------------------------------------------------------------------------------------------ diff --git a/compose.yaml b/compose.yaml index 7cbc61c..1190178 100644 --- a/compose.yaml +++ b/compose.yaml @@ -2,10 +2,13 @@ #------------------------------------------------------------------------------- name: ${IMG_ID} + services: + webapp: container_name: ${IMG_ID} image: docker.xor.rx3:5000/rx3/${IMG_ID}:${IMG_VERSION} + build: context: . args: @@ -13,7 +16,14 @@ services: - IMG_NAME=${IMG_NAME} - IMG_VERSION=${IMG_VERSION} - IMG_MAINTAINER=${IMG_MAINTAINER} + restart: unless-stopped + + environment: + APACHE_UID: ${APACHE_UID} + APACHE_GID: ${APACHE_GID} + network_mode: bridge + ports: - "127.0.0.1:8080:80"