Compare commits

..

No commits in common. "master" and "ampache-mga9-1.1.1" have entirely different histories.

14 changed files with 97 additions and 273 deletions

29
.env Normal file
View File

@ -0,0 +1,29 @@
# Rx3 Ampache 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="ampache-mga9"
IMG_FULL_NAME="Rx3 Ampache Mageia-9 Docker Image"
IMG_VERSION="1.1.1"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
ARG IMG_URL_PREFIX="rx3" ARG IMG_URL_PREFIX="rx3"
FROM ${IMG_URL_PREFIX}/php-apache-mga9:1.3.3 FROM ${IMG_URL_PREFIX}/php-apache-mga9:1.3.1
ARG IMG_NAME ARG IMG_NAME
ARG IMG_FULL_NAME ARG IMG_FULL_NAME
@ -12,7 +12,7 @@ ARG IMG_MAINTAINER
ARG AMPACHE_VERSION=6.6.0 ARG AMPACHE_VERSION=6.6.0
ENV DISABLE_INOTIFYWAIT_CLEAN=0 ENV DISABLE_INOTIFYWAIT_CLEAN 0
LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME} LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
@ -24,37 +24,30 @@ LABEL maintainer=${IMG_MAINTAINER}
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
ARG AMPACHE='#!/bin/bash \n\ ARG AMPACHE='#!/bin/bash \n\
\n\ \n\
cp -f /var/tmp/ampache.cfg.php.dist /var/www/config \n\ cp -f /var/www/config/ampache.cfg.php.dist /var/www/config \n\
\n\ \n\
chown -R apache:apache /var/www/config /var/log/ampache' chown -R apache:apache /var/www/config /var/log/ampache'
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG AMPACHE_CRON='# /etc/cron.d/ampache: crontab fragment for ampache server \n\
\n\
PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin \n\
\n\
15 3 * * * apache cd /var/www; php bin/cli run:updateCatalog -v -c -e -a -g >/var/log/ampache/catalog_update.log 2>&1'
#---------------------------------------------------------------------------------------------------
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 \
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 \
&& 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 \
&& 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 \
&& 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/$transcode_cfg != '"'"'never'"'"'/$transcode_cfg != '"'"'ever'"'"'/' /var/www/src/Module/Util/Waveform.php \ && cp -f /var/www/public/rest/.htaccess.dist /var/www/public/rest/.htaccess \
&& sed -i -e 's/ || static::getUserRepository()->idByEmail($email) > 0//' /var/www/src/Repository/Model/User.php \ && cp -f /var/www/public/play/.htaccess.dist /var/www/public/play/.htaccess \
&& cp -f /var/www/public/rest/.htaccess.dist /var/www/public/rest/.htaccess \ && cp -f /var/www/config/ampache.cfg.php.dist /var/tmp \
&& cp -f /var/www/public/play/.htaccess.dist /var/www/public/play/.htaccess \ && 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 \
&& cp -f /var/www/config/ampache.cfg.php.dist /var/tmp \ && find /var/www -type d -name ".git*" -print0 | xargs -0 rm -rf {} \
&& 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 \ && chown -R root:root /var/www \
&& find /var/www -type d -name ".git*" -print0 | xargs -0 rm -rf {} \ && chmod -R 775 /var/www \
&& chown -R root:root /var/www \ && echo -e '${AMPACHE}' | sed -e 's/ *$//' > /etc/init.d/ampache \
&& chmod -R 775 /var/www \ && chmod a+x /etc/init.d/ampache \
&& echo -e "${AMPACHE}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/ampache \ && ln -s /etc/init.d/ampache /etc/rcD.d/S40ampache \
&& chmod a+x /etc/init.d/ampache \ && sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = 32M/" /etc/php.d/01_fileuploads.ini \
&& ln -s /etc/init.d/ampache /etc/rcD.d/S40ampache && sed -i -e "s/post_max_size = 8M/post_max_size = 32M/" /etc/php.d/01_datahandling.ini
VOLUME ["/var/www/html/config"] VOLUME ["/var/www/html/config"]

View File

@ -5,8 +5,7 @@ Welcome to Rx3/Ampache-Mga9 docker image!
This is project aims to build a Ampache + Mageia 9 docker image. This is project aims to build a Ampache + Mageia 9 docker image.
Features: Features:
- Based on rx3/php-apache-mga9:1.3.3 & rx3/mariadb-mga9:1.0.2 images, - ...
- Support mysql & external pwauth authentication.

View File

@ -1,50 +1,3 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Ampache-Mga9 V 1.2.3 - A. GIBERT - 2024/10/xx
------------------------------------------------------------------------------------------------------------------------------------
- Fix crontab: user ampache user instead of root and add it to git,
- Fix database restart in compose file,
- Add database healthcheck & webapp service depencies.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Ampache-Mga9 V 1.2.2 - A. GIBERT - 2024/10/06
------------------------------------------------------------------------------------------------------------------------------------
- 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,
- local directory normalization,
- fix ampache.cfg.php.dist initialization.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Ampache-Mga9 V 1.2.1 - A. GIBERT - 2024/08/28
------------------------------------------------------------------------------------------------------------------------------------
- Switch to rx3/php-apache-mga9:1.3.2 image,
- Switch to rx3/mariadb-mga9:1.0.1 image,
- Fix /usr/bin/pwauth group & mode,
- Fix Ampache Repository/Model/User.php: remove email lookup for new user.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/Ampache-Mga9 V 1.2.0 - A. GIBERT - 2024/08/27
------------------------------------------------------------------------------------------------------------------------------------
- Switch to rx3/mariadb-mga9:1.0.0 image,
- Now full Rx3 based!
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Rx3/Ampache-Mga9 V 1.1.1 - A. GIBERT - 2024/08/27 Rx3/Ampache-Mga9 V 1.1.1 - A. GIBERT - 2024/08/27
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@ -1,120 +1,100 @@
# Rx3 Ampache Mageia-9 Docker Image # Rx3 Ampache Mageia-9 Docker Image
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
name: ${APPL_NAME} name: ${IMG_NAME}
services: services:
database: database:
container_name: ${DATABASE_CONT_NAME} container_name: ${IMG_NAME}-mysql
image: ${DATABASE_IMG} image: mariadb:11.4.3-ubi9
restart: unless-stopped
environment: environment:
MARIADB_UID: ${MARIADB_UID} MARIADB_ROOT_PASSWORD: mysqladmin
MARIADB_GID: ${MARIADB_GID} MARIADB_DATABASE: ampache
MARIADB_ROOT_HOST: ${MARIADB_ROOT_HOST} MARIADB_USER: ampache
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} MARIADB_PASSWORD: ampacheadmin
MARIADB_DATABASE: ${MARIADB_DATABASE} MARIADB_ROOT_HOST: '%' # needs to be enclosed with quotes
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
healthcheck: user: "983:981"
test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p${MARIADB_ROOT_PASSWORD}' ]
interval: 10s
timeout: 3s
retries: 3
volumes: volumes:
- ./var/lib/mysql:/var/lib/mysql - ./mysql:/var/lib/mysql
networks: networks:
- appl - ampache
ports:
- "127.0.0.1:${DATABASE_SV_PORT}:9001"
- "127.0.0.1:${DATABASE_PORT}:3306"
webapp-internal: webapp-internal:
container_name: ${WEBAPP_INT_CONT_NAME} container_name: ${IMG_NAME}-internal
image: ${WEBAPP_IMG} image: ${IMG_URL}
build: build:
context: . context: .
args: args:
- IMG_NAME=${APPL_NAME} - IMG_NAME=${IMG_NAME}
- IMG_FULL_NAME=${APPL_FULL_NAME} - IMG_FULL_NAME=${IMG_FULL_NAME}
- IMG_VERSION=${APPL_VERSION} - IMG_VERSION=${IMG_VERSION}
- IMG_MAINTAINER=${APPL_MAINTAINER} - IMG_MAINTAINER=${IMG_MAINTAINER}
- IMG_URL_PREFIX=${APPL_URL_PREFIX} - IMG_URL_PREFIX=${IMG_URL_PREFIX}
restart: unless-stopped restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment: environment:
APACHE_UID: ${APACHE_UID} - APACHE_UID=980
APACHE_GID: ${APACHE_GID} - APACHE_GID=977
APACHE_DOC_ROOT: ${APACHE_DOC_ROOT} - APACHE_DOC_ROOT=/var/www/public
- DISABLE_INOTIFYWAIT_CLEAN=1
volumes: volumes:
- ./etc/ampache-internal:/var/www/config - ./ampache-internal/config:/var/www/config
- ./var/log/ampache-internal:/var/log/ampache - ./ampache-internal/log:/var/log/ampache
- ./etc/cron.d/ampache:/etc/cron.d/ampache:ro - ./etc/cron.d/ampache:/etc/cron.d/ampache:ro
- /etc/passwd:/etc/passwd:ro - /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro - /etc/group:/etc/group:ro
- /etc/shadow:/etc/shadow:ro - /etc/shadow:/etc/shadow:ro
- ${MUSIC_REPO}:/media/music - ./media/music:/media/music
- ${VIDEO_REPO}:/media/video - ./media/video:/media/video
networks: networks:
- appl - ampache
ports: ports:
- "127.0.0.1:${WEBAPP_INT_SV_PORT}:9001" - "127.0.0.1:9085:9001"
- "127.0.0.1:${WEBAPP_INT_PORT}:80" - "127.0.0.1:8085:80"
webapp-external: webapp-external:
container_name: ${WEBAPP_EXT_CONT_NAME} container_name: ${IMG_NAME}-external
image: ${WEBAPP_IMG} image: ${IMG_URL}
restart: unless-stopped restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment: environment:
APACHE_UID: ${APACHE_UID} - APACHE_UID=980
APACHE_GID: ${APACHE_GID} - APACHE_GID=977
APACHE_DOC_ROOT: ${APACHE_DOC_ROOT} - APACHE_DOC_ROOT=/var/www/public
- DISABLE_INOTIFYWAIT_CLEAN=1
volumes: volumes:
- ./etc/ampache-external:/var/www/config - ./ampache-external/config:/var/www/config
- ./var/log/ampache-external:/var/log/ampache - ./ampache-external/log:/var/log/ampache
- /etc/passwd:/etc/passwd:ro - /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro - /etc/group:/etc/group:ro
- ${MUSIC_REPO}:/media/music - ./media/music:/media/music
- ${VIDEO_REPO}:/media/video - ./media/video:/media/video
networks: networks:
- appl - ampache
ports: ports:
- "127.0.0.1:${WEBAPP_EXT_SV_PORT}:9001" - "127.0.0.1:9086:9001"
- "127.0.0.1:${WEBAPP_EXT_PORT}:80" - "127.0.0.1:8086:80"
networks: networks:
appl: ampache:
name: ${NETWORK_NAME} name: ampache
driver: bridge driver: bridge
driver_opts: driver_opts:
com.docker.network.bridge.name: ${NETWORK_IF_NAME} com.docker.network.bridge.name: br-ampache
ipam: ipam:
config: config:
- subnet: 10.2.33.0/24 - subnet: 10.2.33.0/24

View File

@ -1,97 +0,0 @@
# Rx3 Ampache Mageia-9 Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
APPL_ORG="rx3"
APPL_REGISTRY="docker.xor.rx3:5000"
APPL_URL_PREFIX="${APPL_REGISTRY}/${APPL_ORG}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
APPL_NAME="ampache-mga9"
APPL_FULL_NAME="Rx3 Ampache Mageia-9 Docker Image"
APPL_SHORT_NAME="ampache"
APPL_VERSION="1.2.2"
APPL_URL="${APPL_URL_PREFIX}/${APPL_NAME}:${APPL_VERSION}"
APPL_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
#APPL_ENV="prd"
#APPL_ENV="tst"
#APPL_ENV="int"
APPL_ENV="dvp"
MUSIC_REPO="./opt/music"
VIDEO_REPO="./opt/video"
#-------------------------------------------------------------------------------
# Common
#-------------------------------------------------------------------------------
if [[ "${APPL_ENV}" != "prd" ]]
then
APPL_SUFFIX="-${APPL_ENV}"
ENV_PORT_OFFSET=100
else
APPL_SUFFIX=""
ENV_PORT_OFFSET=0
fi
CONT_NAME_PREFIX=${APPL_NAME/-mga9}${APPL_SUFFIX}
SV_PORT_OFFSET=1000
NETWORK_NAME=${CONT_NAME_PREFIX}
NETWORK_IF_NAME=br-${APPL_SHORT_NAME}-${APPL_ENV}
#-------------------------------------------------------------------------------
# Database
#-------------------------------------------------------------------------------
DATABASE_IMG=${APPL_URL_PREFIX}/mariadb-mga9:1.0.2
DATABASE_CONT_NAME="${CONT_NAME_PREFIX}-database"
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
MARIADB_ROOT_PASSWORD="mysqladmin"
MARIADB_DATABASE="ampache"
MARIADB_USER="ampache"
MARIADB_PASSWORD="ampacheadmin"
#-------------------------------------------------------------------------------
# WebApp
#-------------------------------------------------------------------------------
WEBAPP_IMG=${APPL_URL}
WEBAPP_INT_CONT_NAME="${CONT_NAME_PREFIX}-webapp-internal"
WEBAPP_INT_PORT=$(( 8085 + ${ENV_PORT_OFFSET}))
WEBAPP_INT_SV_PORT=$(( ${WEBAPP_INT_PORT} + ${SV_PORT_OFFSET}))
WEBAPP_EXT_CONT_NAME="${CONT_NAME_PREFIX}-webapp-external"
WEBAPP_EXT_PORT=$(( ${WEBAPP_INT_PORT} + 1))
WEBAPP_EXT_SV_PORT=$(( ${WEBAPP_EXT_PORT} + ${SV_PORT_OFFSET}))
APACHE_UID=980
APACHE_GID=977
APACHE_DOC_ROOT=/var/www/public

View File

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

View File

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

View File

@ -1,5 +0,0 @@
# /etc/cron.d/ampache: crontab fragment for ampache server
PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
15 3 * * * apache cd /var/www; php bin/cli run:updateCatalog -v -c -e -a -g >/var/log/ampache/catalog_update.log 2>&1

View File

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

View File

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

4
var/lib/.gitignore vendored
View File

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

View File

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

View File

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