From c70bea95932f8cd75b56022327e07ffe0d169ab1 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 5 Oct 2024 18:19:58 +0200 Subject: [PATCH] - Now use rx3/php-apache-mga9:1.3.3 image: - PHP memory limit increased from 128M to 512M, - mpm support, - pwauth support, - Remove now unneeded pwauth install & PHP config. - Now use rx3/mariadb-mga9:1.0.2 - Variabilization of external server ports in env & compose file, - Now use docker_tools for .env building. --- Dockerfile | 40 ++++++++++++++++++---------------------- ReadMe.txt | 2 +- ReleaseNotes.txt | 15 +++++++++++++++ compose.yaml | 16 +++++++++------- .env => env | 15 ++++++++++++++- 5 files changed, 57 insertions(+), 31 deletions(-) rename .env => env (74%) diff --git a/Dockerfile b/Dockerfile index 82e958d..9702603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG IMG_URL_PREFIX="rx3" -FROM ${IMG_URL_PREFIX}/php-apache-mga9:1.3.2 +FROM ${IMG_URL_PREFIX}/php-apache-mga9:1.3.3 ARG IMG_NAME ARG IMG_FULL_NAME @@ -26,9 +26,7 @@ ARG AMPACHE='#!/bin/bash \n\ cp -f /var/www/config/ampache.cfg.php.dist /var/www/config \n\ \n\ -chown -R apache:apache /var/www/config /var/log/ampache \n\ -chgrp apache /usr/bin/pwauth \n\ -chmod u+s /usr/bin/pwauth' +chown -R apache:apache /var/www/config /var/log/ampache' #--------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------- @@ -41,24 +39,22 @@ PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin -RUN urpmi --force wget ffmpeg lib64opencl1 flac inotify-tools lame lib64avcodec59 lib64event7 lib64mp3lame-devel lib64theora-devel lib64vorbis-devel lib64vpx-devel php-iconv php-curl php-gd php-intl php-ldap php-sabre-xml php-zip supervisor vorbis-tools zip unzip pwauth \ - && mkdir -p /var/log/ampache \ - && wget -q -O /tmp/ampache.zip https://github.com/ampache/ampache/releases/download/${AMPACHE_VERSION}/ampache-${AMPACHE_VERSION}_all_php8.2.zip \ - && unzip /tmp/ampache.zip -d /var/www \ - && sed -i -e 's/$transcode_cfg != '"'"'never'"'"'/$transcode_cfg != '"'"'ever'"'"'/' /var/www/src/Module/Util/Waveform.php \ - && sed -i -e 's/ || static::getUserRepository()->idByEmail($email) > 0//' /var/www/src/Repository/Model/User.php \ - && cp -f /var/www/public/rest/.htaccess.dist /var/www/public/rest/.htaccess \ - && cp -f /var/www/public/play/.htaccess.dist /var/www/public/play/.htaccess \ - && cp -f /var/www/config/ampache.cfg.php.dist /var/tmp \ - && rm -f /tmp/ampache.zip /var/www/public/.php*cs* /var/www/public/.sc /var/www/public/.scrutinizer.yml /var/www/public/.tgitconfig /var/www/public/.travis.yml /var/www/public/*.md \ - && find /var/www -type d -name ".git*" -print0 | xargs -0 rm -rf {} \ - && chown -R root:root /var/www \ - && chmod -R 775 /var/www \ - && echo -e "${AMPACHE}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/ampache \ - && chmod a+x /etc/init.d/ampache \ - && ln -s /etc/init.d/ampache /etc/rcD.d/S40ampache \ - && sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = 32M/" /etc/php.d/01_fileuploads.ini \ - && sed -i -e "s/post_max_size = 8M/post_max_size = 32M/" /etc/php.d/01_datahandling.ini +RUN urpmi --force wget ffmpeg lib64opencl1 flac inotify-tools lame lib64avcodec59 lib64event7 lib64mp3lame-devel lib64theora-devel lib64vorbis-devel lib64vpx-devel php-iconv php-curl php-gd php-intl php-ldap php-sabre-xml php-zip vorbis-tools zip unzip \ + && mkdir -p /var/log/ampache \ + && wget -q -O /tmp/ampache.zip https://github.com/ampache/ampache/releases/download/${AMPACHE_VERSION}/ampache-${AMPACHE_VERSION}_all_php8.2.zip \ + && unzip /tmp/ampache.zip -d /var/www \ + && sed -i -e 's/$transcode_cfg != '"'"'never'"'"'/$transcode_cfg != '"'"'ever'"'"'/' /var/www/src/Module/Util/Waveform.php \ + && sed -i -e 's/ || static::getUserRepository()->idByEmail($email) > 0//' /var/www/src/Repository/Model/User.php \ + && cp -f /var/www/public/rest/.htaccess.dist /var/www/public/rest/.htaccess \ + && cp -f /var/www/public/play/.htaccess.dist /var/www/public/play/.htaccess \ + && cp -f /var/www/config/ampache.cfg.php.dist /var/tmp \ + && rm -f /tmp/ampache.zip /var/www/public/.php*cs* /var/www/public/.sc /var/www/public/.scrutinizer.yml /var/www/public/.tgitconfig /var/www/public/.travis.yml /var/www/public/*.md \ + && find /var/www -type d -name ".git*" -print0 | xargs -0 rm -rf {} \ + && chown -R root:root /var/www \ + && chmod -R 775 /var/www \ + && echo -e "${AMPACHE}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/ampache \ + && chmod a+x /etc/init.d/ampache \ + && ln -s /etc/init.d/ampache /etc/rcD.d/S40ampache VOLUME ["/var/www/html/config"] diff --git a/ReadMe.txt b/ReadMe.txt index 66f6835..5934ffd 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -5,7 +5,7 @@ Welcome to Rx3/Ampache-Mga9 docker image! This is project aims to build a Ampache + Mageia 9 docker image. Features: - - Based on rx3/php-apache-mga9:1.3.2 & rx3/mariadb-mga9:1.0.1 images, + - Based on rx3/php-apache-mga9:1.3.3 & rx3/mariadb-mga9:1.0.2 images, - Support mysql & external pwauth authentication. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 5b7fd65..64ef860 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,18 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3/Ampache-Mga9 V 1.2.2 - A. GIBERT - 2024/10/05 +------------------------------------------------------------------------------------------------------------------------------------ + +- Now use rx3/php-apache-mga9:1.3.3 image: + - PHP memory limit increased from 128M to 512M, + - mpm support, + - pwauth support, +- Remove now unneeded pwauth install & PHP config. +- Now use rx3/mariadb-mga9:1.0.2 +- Variabilization of external server ports in env & compose file, +- Now use docker_tools for .env building. + + + ------------------------------------------------------------------------------------------------------------------------------------ Rx3/Ampache-Mga9 V 1.2.1 - A. GIBERT - 2024/08/28 ------------------------------------------------------------------------------------------------------------------------------------ diff --git a/compose.yaml b/compose.yaml index 367f2c3..dccb04e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -7,7 +7,7 @@ services: database: container_name: ${IMG_NAME}-mysql - image: ${IMG_URL_PREFIX}/mariadb-mga9:1.0.1 + image: ${IMG_URL_PREFIX}/mariadb-mga9:1.0.2 environment: MARIADB_UID: ${MARIADB_UID} @@ -25,8 +25,8 @@ services: - ampache ports: - - "127.0.0.1:9006:9001" - - "127.0.0.1:8006:3306" + - "127.0.0.1:${DATABASE_SV_PORT}:9001" + - "127.0.0.1:${DATABASE_PORT}:3306" webapp-internal: container_name: ${IMG_NAME}-internal @@ -62,9 +62,10 @@ services: networks: - ampache + ports: - - "127.0.0.1:9085:9001" - - "127.0.0.1:8085:80" + - "127.0.0.1:${WEBAPP_INT_SV_PORT}:9001" + - "127.0.0.1:${WEBAPP_INT_PORT}:80" webapp-external: container_name: ${IMG_NAME}-external @@ -89,9 +90,10 @@ services: networks: - ampache + ports: - - "127.0.0.1:9086:9001" - - "127.0.0.1:8086:80" + - "127.0.0.1:${WEBAPP_EXT_SV_PORT}:9001" + - "127.0.0.1:${WEBAPP_EXT_PORT}:80" networks: ampache: diff --git a/.env b/env similarity index 74% rename from .env rename to env index 337dac7..585f395 100644 --- a/.env +++ b/env @@ -18,7 +18,7 @@ IMG_URL_PREFIX="${IMG_REGISTRY}/${IMG_ORG}" IMG_NAME="ampache-mga9" IMG_FULL_NAME="Rx3 Ampache Mageia-9 Docker Image" -IMG_VERSION="1.2.1" +IMG_VERSION="1.2.2" IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}" IMG_MAINTAINER='"Arnaud G. GIBERT" ' @@ -28,6 +28,12 @@ IMG_MAINTAINER='"Arnaud G. GIBERT" ' # User Settings #------------------------------------------------------------------------------- +ENV_PORT_OFFSET=0 +SV_PORT_OFFSET=1000 + +DATABASE_PORT=$(( 8006 + ${ENV_PORT_OFFSET})) +DATABASE_SV_PORT=$(( ${DATABASE_PORT} + ${SV_PORT_OFFSET})) + MARIADB_UID=983 MARIADB_GID=981 MARIADB_ROOT_HOST='%' # needs to be enclosed with quotes @@ -35,3 +41,10 @@ MARIADB_ROOT_PASSWORD="mysqladmin" MARIADB_DATABASE="ampache" MARIADB_USER="ampache" MARIADB_PASSWORD="ampacheadmin" + +WEBAPP_INT_PORT=$(( 8085 + ${ENV_PORT_OFFSET})) +WEBAPP_INT_SV_PORT=$(( ${WEBAPP_INT_PORT} + ${SV_PORT_OFFSET})) + +WEBAPP_EXT_PORT=$(( ${WEBAPP_INT_PORT} + 1)) +WEBAPP_EXT_SV_PORT=$(( ${WEBAPP_EXT_PORT} + ${SV_PORT_OFFSET})) +