Compare commits

...

5 Commits

Author SHA1 Message Date
08ec413f3a - Now use rx3/server-mga9:1.1.2 image,
- Fix Apache root document not updated in /etc/httpd/conf/conf.d/rx3.conf.
2024-08-28 18:41:37 +02:00
9736f81016 - Now use rx3/server-mga9:1.1.1 image,
- Remove test init service,
- Minor compose / dockerfile args & structure improvements.
2024-08-27 00:57:56 +02:00
54ccdf959e - Now use rx3/server-mga9:1.1.0 image,
- supervisor & logrotate configured.
2024-08-26 22:07:22 +02:00
1d1674ebac - Add and use APACHE_DOC_ROOT environment variable,
- Move apache_init script to /usr/local/sbin,
- Use base-mga9:1.2.1.
2024-08-24 23:23:23 +02:00
f82f70e46f - Add PHP PDO PostgreSQL & MySQL modules,
- Add and use APACHE_UID & APACHE_GID environement variable.
2024-08-24 12:57:19 +02:00
5 changed files with 155 additions and 21 deletions

34
.env
View File

@ -1,4 +1,32 @@
IMG_ID="php-apache-mga9" # Rx3 PHP Apache Mageia-9 Docker Image
IMG_NAME="Rx3 PHP Apache Mageia-9 Docker Image" #-------------------------------------------------------------------------------
IMG_VERSION="1.0.0"
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
IMG_ORG="rx3"
IMG_REGISTRY="docker.xor.rx3:5000"
IMG_URL_PREFIX="${IMG_REGISTRY}/${IMG_ORG}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
IMG_NAME="php-apache-mga9"
IMG_FULL_NAME="Rx3 PHP Apache Mageia-9 Docker Image"
IMG_VERSION="1.3.2"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>' IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
APACHE_UID=980
APACHE_GID=977
APACHE_DOC_ROOT=/var/www/html

View File

@ -1,25 +1,68 @@
# Rx3 PHP Apache Mageia-9 Docker Image # Rx3 PHP Apache Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
FROM docker.xor.rx3:5000/rx3/base-mga9:1.2.0 ARG IMG_URL_PREFIX="rx3"
FROM ${IMG_URL_PREFIX}/server-mga9:1.1.2
ARG IMG_ID
ARG IMG_NAME ARG IMG_NAME
ARG IMG_FULL_NAME
ARG IMG_VERSION ARG IMG_VERSION
ARG IMG_MAINTAINER ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_ID}.name=${IMG_NAME} LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME}
LABEL org.rx3.${IMG_ID}.version=${IMG_VERSION} LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_ID}.maintainer=${IMG_MAINTAINER} LABEL org.rx3.${IMG_NAME}.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 \
&& 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 ARG HTTPD_CONF='RewriteEngine On \n\
<Directory /var/www/html> \n\
Options Includes Indexes FollowSymLinks \n\
AllowOverride All \n\
Require all granted \n\
</Directory>'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG INFO_PHP='<?php \n\
phpinfo(); \n\
phpinfo(INFO_MODULES); \n\
?>'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG HTTPD='#!/bin/bash \n\
\n\
usermod -u ${APACHE_UID} apache \n\
groupmod -g ${APACHE_GID} apache \n\
\n\
chown -R apache:apache /var/log/httpd \n\
\n\
for file in /etc/httpd/conf/httpd.conf /etc/httpd/conf/conf.d/rx3.conf \n\
do \n\
sed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" ${file} \n\
done'
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG HTTPD_INI='[program:httpd] \n\
command=/usr/sbin/httpd -DFOREGROUND'
#---------------------------------------------------------------------------------------------------
RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer \
&& echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/httpd/conf/conf.d/rx3.conf \
&& echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php \
&& echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \
&& chmod a+x /etc/init.d/httpd \
&& ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \
&& echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini
VOLUME /var/www/html VOLUME /var/www/html
EXPOSE 80 EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd", "-DFOREGROUND"]

View File

@ -1,13 +1,15 @@
Welcome to php-apache-mga9 docker image! Welcome to Rx3/PHP-Apache-Mga9 docker image!
This is project aims to build a PHP + Apache + Mageia 9 docker image used by others Rx3 packaging projects. This is project aims to build a PHP + Apache + Mageia 9 docker image used by others Rx3 packaging projects.
Features: Features:
- Curtently based on base-mga9:1.2.0 image, - Curtently based on rx3/server-mga9:1.1.2 image,
- PostgreSQL & MySQL ready, - PostgreSQL & MySQL ready,
- PHPMailer installed. - PHPMailer installed,
- logrotate configured,
- Apache UID, GID & document root directory configurable.
Enjoy it! Enjoy it!

View File

@ -1,5 +1,52 @@
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
PHP-Apache-Mga9 V 1.0.0 - A. GIBERT - 2024/08/22 Rx3/PHP-Apache-Mga9 V 1.3.2 - A. GIBERT - 2024/08/28
------------------------------------------------------------------------------------------------------------------------------------
- Now use rx3/server-mga9:1.1.2 image,
- Fix Apache root document not updated in /etc/httpd/conf/conf.d/rx3.conf.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/PHP-Apache-Mga9 V 1.3.1 - A. GIBERT - 2024/08/27
------------------------------------------------------------------------------------------------------------------------------------
- Now use rx3/server-mga9:1.1.1 image,
- Remove test init service,
- Minor compose / dockerfile args & structure improvements.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/PHP-Apache-Mga9 V 1.3.0 - A. GIBERT - 2024/08/26
------------------------------------------------------------------------------------------------------------------------------------
- Now use rx3/server-mga9:1.1.0 image,
- supervisor & logrotate configured.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/PHP-Apache-Mga9 V 1.2.0 - A. GIBERT - 2024/08/24
------------------------------------------------------------------------------------------------------------------------------------
- Add and use APACHE_DOC_ROOT environment variable,
- Move apache_init script to /usr/local/sbin,
- Use base-mga9:1.2.1.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/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 environment variable.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/PHP-Apache-Mga9 V 1.0.0 - A. GIBERT - 2024/08/22
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Initial release, - Initial release,

View File

@ -1,19 +1,33 @@
# Rx3 PHP Apache Mageia-9 Docker Image # Rx3 PHP Apache Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
name: ${IMG_ID} name: ${IMG_NAME}
services: services:
webapp: webapp:
container_name: ${IMG_ID} container_name: ${IMG_NAME}
image: docker.xor.rx3:5000/rx3/${IMG_ID}:${IMG_VERSION}
image: ${IMG_URL}
build: build:
context: . context: .
args: args:
- IMG_ID=${IMG_ID}
- IMG_NAME=${IMG_NAME} - IMG_NAME=${IMG_NAME}
- IMG_FULL_NAME=${IMG_FULL_NAME}
- IMG_VERSION=${IMG_VERSION} - IMG_VERSION=${IMG_VERSION}
- IMG_MAINTAINER=${IMG_MAINTAINER} - IMG_MAINTAINER=${IMG_MAINTAINER}
- IMG_URL_PREFIX=${IMG_URL_PREFIX}
restart: unless-stopped restart: unless-stopped
environment:
APACHE_UID: ${APACHE_UID}
APACHE_GID: ${APACHE_GID}
APACHE_DOC_ROOT: ${APACHE_DOC_ROOT}
network_mode: bridge network_mode: bridge
ports: ports:
- "127.0.0.1:9011:9001"
- "127.0.0.1:8080:80" - "127.0.0.1:8080:80"