diff --git a/Dockerfile b/Dockerfile index 15bc0b1..70c9956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,10 @@ LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} LABEL maintainer=${IMG_MAINTAINER} +ARG APACHE_DOC_ROOT +ARG APACHE_LOG_DIR +ARG APACHE_PORT + #--------------------------------------------------------------------------------------------------- @@ -69,6 +73,7 @@ RUN urpmi --force apache apache-mod_php php-cli php-pgsql php-mysqli php-pdo_ && 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 ${APACHE_PORT} diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 58e6c7e..3d6e723 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -5,7 +5,8 @@ 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. +- Use now rx3-docker/server:1.2.0-mga9 image, +- Add /var/log/init, /var/log/supervisor & var/log/httpd volumes. diff --git a/compose.yaml b/compose.yaml index 6ddee5d..df7c0b5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -15,10 +15,13 @@ services: context: . args: IMG_NAME: ${IMG_NAME} - IMG_FULL_NAME: ${IMG_NAME_FULL} + IMG_NAME_FULL: ${IMG_NAME_FULL} IMG_VERSION: ${IMG_VERSION} IMG_MAINTAINER: ${IMG_MAINTAINER} IMG_FROM_URL: ${IMG_FROM_URL} + + APACHE_DOC_ROOT: ${WEBAPP_DOC_ROOT} + APACHE_LOG_DIR: ${WEBAPP_LOG_HTTPD_DIR} APACHE_PORT: ${WEBAPP_PORT_MAIN_INT} restart: unless-stopped @@ -26,7 +29,7 @@ services: environment: APACHE_UID: ${APACHE_UID} APACHE_GID: ${APACHE_GID} - APACHE_DOC_ROOT: ${APACHE_DOC_ROOT} + APACHE_DOC_ROOT: ${WEBAPP_DOC_ROOT} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:${WEBAPP_PORT_MAIN_INT}"] @@ -34,9 +37,12 @@ services: timeout: 3s retries: 3 -# volumes: -# - ./var/www/html:/var/www/html - + volumes: +# - ./var/www/html:${WEBAPP_DOC_ROOT} + - ./var/log/init:${WEBAPP_LOG_INIT_DIR} + - ./var/log/supervisor:${WEBAPP_LOG_SV_DIR} + - ./var/log/httpd:${WEBAPP_LOG_HTTPD_DIR} + ports: - "127.0.0.1:${WEBAPP_PORT_SV_EXT}:${WEBAPP_PORT_SV_INT}" - "127.0.0.1:${WEBAPP_PORT_MAIN_EXT}:${WEBAPP_PORT_MAIN_INT}" diff --git a/env.dist b/env.dist index a2c5285..7d85a2b 100644 --- a/env.dist +++ b/env.dist @@ -41,6 +41,11 @@ WEBAPP_PORT_MAIN_INT=80 WEBAPP_PORT_SV_EXT=$(( ${WEBAPP_PORT_MAIN_EXT} + ${SV_PORT_OFFSET})) WEBAPP_PORT_SV_INT=9001 +WEBAPP_LOG_INIT_DIR="/var/log/init" +WEBAPP_LOG_SV_DIR="/var/log/supervisor" +WEBAPP_LOG_HTTPD_DIR="/var/log/httpd" + +WEBAPP_DOC_ROOT="/var/www/html" + APACHE_UID=980 APACHE_GID=977 -APACHE_DOC_ROOT=/var/www/html diff --git a/var/log/httpd/.gitignore b/var/log/httpd/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/httpd/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init/.gitignore b/var/log/init/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor/.gitignore b/var/log/supervisor/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore