8 Commits

Author SHA1 Message Date
47adc99eba - Remove stupid /var/log/README broken link. 2025-09-22 18:21:29 +02:00
6263b0cba6 - Use now rx3-docker/server:1.2.6-mga9 image,
- Rebuild for updates.
2025-09-19 18:23:38 +02:00
e63b7c338c - Use now rx3-docker/server:1.2.2-mga9 image. 2025-04-21 17:47:27 +02:00
0b2b46314d - Add PHP_MEMORY_LIMIT & PHP_UPLOAD_LIMIT environment variable,
- Use now rx3-docker/server:1.2.1-mga9 image.
2025-03-08 12:31:27 +01:00
c3f77114c3 - Add Apache enabling via APACHE_HTTPD_ENABLE environement variable. 2024-12-31 20:02:25 +01:00
56e78a5132 - Add apache mod proxy to support reverse proxy configuration. 2024-12-21 11:36:21 +01:00
2de510e467 - Add /var/log/init, /var/log/supervisor & var/log/httpd volumes. 2024-11-11 23:41:36 +01:00
4797d18971 - Move & Rename repo from Rx3/PHP-Apache-MGA9 to Rx3-Docker/PHP-Apache,
- New version naming standard,
- Now use docker_tools for .env building,
- Use now rx3-docker/server:1.2.0-mga9 image.
2024-11-11 10:50:01 +01:00
9 changed files with 240 additions and 115 deletions

View File

@@ -1,44 +1,39 @@
# Rx3 PHP Apache Mageia-9 Docker Image # Rx3-Docker/PHP-Apache Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ARG IMG_URL_PREFIX="rx3" ARG IMG_FROM_URL="rx3-docker/server:latest"
FROM ${IMG_URL_PREFIX}/server-mga9:1.1.3 FROM ${IMG_FROM_URL}
ARG IMG_NAME ARG IMG_NAME
ARG IMG_FULL_NAME ARG IMG_NAME_FULL
ARG IMG_VERSION ARG IMG_VERSION
ARG IMG_MAINTAINER ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME} LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER} LABEL maintainer=${IMG_MAINTAINER}
ARG APACHE_DOC_ROOT
ARG APACHE_LOG_DIR
ARG APACHE_PORT
#---------------------------------------------------------------------------------------------------
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\ ARG HTTPD='#!/bin/bash \n\
\n\ \n\
usermod -u ${APACHE_UID} apache \n\ usermod -u ${APACHE_UID} apache \n\
groupmod -g ${APACHE_GID} apache \n\ groupmod -g ${APACHE_GID} apache \n\
\n\ \n\
chgrp apache /usr/bin/pwauth \n\
chmod u+s /usr/bin/pwauth \n\
\n\
if [[ "${APACHE_HTTPD_ENABLED}" == "FALSE" ]] \n\
then \n\
mv /etc/supervisord.d/httpd.ini /etc/supervisord.d/httpd.ini.disabled \n\
else \n\
chown -R apache:apache /var/log/httpd \n\ chown -R apache:apache /var/log/httpd \n\
\n\ \n\
for file in /etc/httpd/conf/httpd.conf /etc/httpd/conf/conf.d/rx3.conf \n\ for file in /etc/httpd/conf/httpd.conf /etc/httpd/conf/conf.d/rx3.conf \n\
@@ -46,29 +41,57 @@ do
sed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" ${file} \n\ sed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" ${file} \n\
done \n\ done \n\
\n\ \n\
chgrp apache /usr/bin/pwauth \n\ if [[ "${PHP_MEMORY_LIMIT}" == "" ]] \n\
chmod u+s /usr/bin/pwauth' then \n\
#--------------------------------------------------------------------------------------------------- PHP_MEMORY_LIMIT="512M" \n\
fi \n\
\n\
if [[ "${PHP_UPLOAD_LIMIT}" == "" ]] \n\
then \n\
PHP_UPLOAD_LIMIT="32M" \n\
fi \n\
\n\
sed -i -e "s/memory_limit = 128M/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php.d/01_ressourcelimits.ini \n\
sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_fileuploads.ini \n\
sed -i -e "s/post_max_size = 8M/post_max_size = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_datahandling.ini \n\
fi'
#----------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------------------------------
ARG HTTPD_INI='[program:httpd] \n\ ARG HTTPD_INI='[program:httpd] \n\
command=/usr/sbin/httpd -DFOREGROUND' command=/usr/sbin/httpd -DFOREGROUND'
#--------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------------------------------------
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\
?>'
#----------------------------------------------------------------------------------------------------------------------------
RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \ RUN urpmi.update -a \
&& echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/httpd/conf/conf.d/rx3.conf \ && urpmi --force apache apache-mod_proxy apache-mod_proxy_html apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \
&& echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php \ && rm -f /var/log/README \
&& echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \ && echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \
&& chmod a+x /etc/init.d/httpd \ && chmod a+x /etc/init.d/httpd \
&& ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \ && 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 \ && echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini \
&& sed -i -e "s/memory_limit = 128M/memory_limit = 512M/" /etc/php.d/01_ressourcelimits.ini \ && echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/httpd/conf/conf.d/rx3.conf \
&& sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = 32M/" /etc/php.d/01_fileuploads.ini \ && echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php
&& sed -i -e "s/post_max_size = 8M/post_max_size = 32M/" /etc/php.d/01_datahandling.ini
VOLUME /var/www/html VOLUME ${APACHE_DOC_ROOT}
VOLUME ${APACHE_LOG_DIR}
EXPOSE 80 EXPOSE ${APACHE_PORT}

View File

@@ -1,15 +1,19 @@
Welcome to Rx3/PHP-Apache-Mga9 docker image! Welcome to Rx3-Docker/PHP-Apache docker image!
This is project aims to build a PHP + Apache + Mageia 9 docker image used by others Rx3 packaging projects. This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects.
Features: Features:
- Curtently based on rx3/server-mga9:1.1.2 image, - Curtently based on rx3-docker/server:1.2.6-mga9 image,
- PostgreSQL & MySQL ready, - PostgreSQL & MySQL ready,
- PHPMailer installed, - PHPMailer installed,
- logrotate configured, - logrotate configured,
- Apache UID, GID & document root directory configurable. - Apache UID, GID & document root directory configurable,
- mod_proxy + mod_proxy_html installed,
- HTTPD service enabled by default (APACHE_HTTPD_ENABLED),
- PHP_MEMORY_LIMIT variable set to 512M by default,
- PHP_UPLOAD_LIMIT variable set to 32M by defaylt.
Enjoy it! Enjoy it!
@@ -18,4 +22,4 @@ Your Rx3 Team.
-- --
arnaud@rx3.net arnaud@rx3.net
https://git.rx3.org/gitea/rx3/php-apache-mga9 https://git.rx3.org/gitea/rx3-docker/php-apache

View File

@@ -1,3 +1,57 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.5.4 - A. GIBERT - 2025/09/19
------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3-docker/server:1.2.6-mga9 image,
- Rebuild for updates.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.5.3 - A. GIBERT - 2025/04/21
------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3-docker/server:1.2.2-mga9 image.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.5.2 - A. GIBERT - 2025/03/08
------------------------------------------------------------------------------------------------------------------------------------
- Add PHP_MEMORY_LIMIT & PHP_UPLOAD_LIMIT environment variable,
- Use now rx3-docker/server:1.2.1-mga9 image.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.5.1 - A. GIBERT - 2024/12/31
------------------------------------------------------------------------------------------------------------------------------------
- Add Apache enabling via APACHE_HTTPD_ENABLED environment variable.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.5.0 - A. GIBERT - 2024/12/21
------------------------------------------------------------------------------------------------------------------------------------
- Add apache mod proxy to support reverse proxy configuration.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.4.0 - A. GIBERT - 2024/11/11
------------------------------------------------------------------------------------------------------------------------------------
- Move & Rename repo from Rx3/PHP-Apache-MGA9 to Rx3-Docker/PHP-Apache,
- New version naming standard,
- Now use docker_tools for .env building,
- Use now rx3-docker/server:1.2.0-mga9 image,
- Add /var/log/init, /var/log/supervisor & var/log/httpd volumes.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Rx3/PHP-Apache-Mga9 V 1.3.3 - A. GIBERT - 2024/10/05 Rx3/PHP-Apache-Mga9 V 1.3.3 - A. GIBERT - 2024/10/05
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -1,36 +1,52 @@
# Rx3 PHP Apache Mageia-9 Docker Image # Rx3-Docker/PHP-Apache Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
name: ${IMG_NAME} name: ${HOST_NAME_PREFIX}
services: services:
webapp: #-------------------------------------------------------------------------------
container_name: ${IMG_NAME}
image: ${IMG_URL} webapp:
container_name: ${WA_HOST_NAME}
hostname: ${WA_HOST_NAME}
image: ${WA_IMG_URL}
build: build:
context: .
args: args:
- IMG_NAME=${IMG_NAME} IMG_NAME: ${WA_IMG_URL}
- IMG_FULL_NAME=${IMG_FULL_NAME} IMG_NAME_FULL: ${WA_IMG_NAME_FULL}
- IMG_VERSION=${IMG_VERSION} IMG_VERSION: ${WA_IMG_VERSION}
- IMG_MAINTAINER=${IMG_MAINTAINER} IMG_MAINTAINER: ${WA_IMG_MAINTAINER}
- IMG_URL_PREFIX=${IMG_URL_PREFIX} IMG_FROM_URL: ${WA_IMG_FROM_URL}
APACHE_DOC_ROOT: ${WA_DOC_ROOT}
APACHE_LOG_DIR: ${WA_LOG_MAIN_INT}
APACHE_PORT: ${WA_PORT_MAIN_INT}
restart: unless-stopped restart: unless-stopped
environment: environment:
APACHE_UID: ${APACHE_UID} APACHE_UID: ${WA_USER_ID}
APACHE_GID: ${APACHE_GID} APACHE_GID: ${WA_GROUP_ID}
APACHE_DOC_ROOT: ${APACHE_DOC_ROOT} APACHE_DOC_ROOT: ${WA_DOC_ROOT}
APACHE_HTTPD_ENABLED: ${WA_APACHE_HTTPD_ENABLED}
PHP_MEMORY_LIMIT: ${WA_PHP_MEMORY_LIMIT}
PHP_UPLOAD_LIMIT: ${WA_PHP_UPLOAD_LIMIT}
# volumes: healthcheck:
# - ./var/www/html:/var/www/html test: ["CMD", "curl", "-f", "http://localhost:${WA_PORT_MAIN_INT}"]
interval: 10s
timeout: 3s
retries: 3
network_mode: bridge volumes:
# - ./${WA_LIB_EXT}:${WA_LIB_INT}
- ./${WA_LOG_INIT_EXT}:${WA_LOG_INIT_INT}
- ./${WA_LOG_SV_EXT}:${WA_LOG_SV_INT}
- ./${WA_LOG_MAIN_EXT}:${WA_LOG_MAIN_INT}
ports: ports:
- "127.0.0.1:${WEBAPP_SV_PORT}:9001" - "127.0.0.1:${WA_PORT_SV_EXT}:${WA_PORT_SV_INT}"
- "127.0.0.1:${WEBAPP_PORT}:80" - "127.0.0.1:${WA_PORT_MAIN_EXT}:${WA_PORT_MAIN_INT}"

38
env
View File

@@ -1,38 +0,0 @@
# Rx3 PHP Apache Mageia-9 Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# 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.3"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
ENV_PORT_OFFSET=0
SV_PORT_OFFSET=1000
WEBAPP_PORT=$(( 8080 + ${ENV_PORT_OFFSET}))
WEBAPP_SV_PORT=$(( ${WEBAPP_PORT} + ${SV_PORT_OFFSET}))
APACHE_UID=980
APACHE_GID=977
APACHE_DOC_ROOT=/var/www/html

54
env.dist Normal file
View File

@@ -0,0 +1,54 @@
# Rx3-Docker/PHP-Apache Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
ORG_NAME="rx3-docker"
ORG_REGISTRY="docker.xor.rx3:5000"
ORG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
HOST_NAME_PREFIX=""
PORT_ENV_OFFSET=0
PORT_SV_INT=9001
PORT_SV_OFFSET=1000
DOCKER_TOOLS_DEBUG=FALSE
DOCKER_TOOLS_VOLUME=SINGLE
#DOCKER_TOOLS_VOLUME=MIXED
#DOCKER_TOOLS_VOLUME=MERGED
#DOCKER_TOOLS_VOLUME=SPLITED
DOCKER_TOOLS_EXEPTION_LIBS="httpd:/var/www/html"
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
# | Variable | Service | Target Image | From Image | Module | Main Port | Admin Port | User | Group |
# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id |
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.5.4-mga9 ${ORG_URL_PREFIX} server 1.2.6-mga9 httpd - 8080 80 - - apache apache
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
SERVER_CROND_ENABLED="FALSE"
WA_DOC_ROOT="/var/www/html"
WA_APACHE_HTTPD_ENABLED="TRUE"
WA_PHP_MEMORY_LIMIT="512M"
WA_PHP_UPLOAD_LIMIT="32M"

4
var/log/httpd/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
var/log/init/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
var/log/supervisor/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore