diff --git a/6.4.0/aio/Dockerfile b/6.4.0/default/Dockerfile similarity index 98% rename from 6.4.0/aio/Dockerfile rename to 6.4.0/default/Dockerfile index 42a63e5..3a3a9a0 100644 --- a/6.4.0/aio/Dockerfile +++ b/6.4.0/default/Dockerfile @@ -1,11 +1,11 @@ -# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian-aio.template +# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian.template FROM debian:bookworm LABEL maintainer="lachlan-00" ENV DEBIAN_FRONTEND=noninteractive ENV MYSQL_PASS **Random** ENV DISABLE_INOTIFYWAIT_CLEAN 0 -ARG VERSION=5.6.1 +ARG VERSION=bookworm RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/20230612T000000Z\nURIs: http://deb.debian.org/debian\nSuites: stable stable-updates\nComponents: main contrib non-free\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n\nTypes: deb\n# http://snapshot.debian.org/archive/debian-security/20230612T000000Z\nURIs: http://deb.debian.org/debian-security\nSuites: stable-security\nComponents: main\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n" > /etc/apt/sources.list.d/debian.sources' \ && apt-get -q -q update \ diff --git a/6.4.0/aio/data/apache2/php.ini b/6.4.0/default/data/apache2/php.ini similarity index 100% rename from 6.4.0/aio/data/apache2/php.ini rename to 6.4.0/default/data/apache2/php.ini diff --git a/6.4.0/aio/data/bin/ampache_cron.sh b/6.4.0/default/data/bin/ampache_cron.sh similarity index 100% rename from 6.4.0/aio/data/bin/ampache_cron.sh rename to 6.4.0/default/data/bin/ampache_cron.sh diff --git a/6.4.0/aio/data/bin/apache2.sh b/6.4.0/default/data/bin/apache2.sh similarity index 100% rename from 6.4.0/aio/data/bin/apache2.sh rename to 6.4.0/default/data/bin/apache2.sh diff --git a/6.4.0/aio/data/bin/create_mysql_admin_user.sh b/6.4.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh similarity index 100% rename from 6.4.0/aio/data/bin/create_mysql_admin_user.sh rename to 6.4.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh diff --git a/6.4.0/aio/data/bin/cron.sh b/6.4.0/default/data/bin/cron.sh similarity index 100% rename from 6.4.0/aio/data/bin/cron.sh rename to 6.4.0/default/data/bin/cron.sh diff --git a/6.4.0/aio/data/bin/docker-entrypoint.sh b/6.4.0/default/data/bin/docker-entrypoint.sh similarity index 100% rename from 6.4.0/aio/data/bin/docker-entrypoint.sh rename to 6.4.0/default/data/bin/docker-entrypoint.sh diff --git a/6.4.0/aio/data/bin/inotifywait.sh b/6.4.0/default/data/bin/inotifywait.sh similarity index 100% rename from 6.4.0/aio/data/bin/inotifywait.sh rename to 6.4.0/default/data/bin/inotifywait.sh diff --git a/6.4.0/aio/data/bin/mysql.sh b/6.4.0/default/data/bin/mysql.tpl_aio.sh similarity index 100% rename from 6.4.0/aio/data/bin/mysql.sh rename to 6.4.0/default/data/bin/mysql.tpl_aio.sh diff --git a/6.4.0/aio/data/bin/run.sh b/6.4.0/default/data/bin/run.tpl_aio.sh similarity index 100% rename from 6.4.0/aio/data/bin/run.sh rename to 6.4.0/default/data/bin/run.tpl_aio.sh diff --git a/6.4.0/apache/data/bin/run.sh b/6.4.0/default/data/bin/run.tpl_apache.sh similarity index 100% rename from 6.4.0/apache/data/bin/run.sh rename to 6.4.0/default/data/bin/run.tpl_apache.sh diff --git a/6.4.0/aio/data/docker-compose.yml b/6.4.0/default/data/docker-compose.tpl_aio.yml similarity index 100% rename from 6.4.0/aio/data/docker-compose.yml rename to 6.4.0/default/data/docker-compose.tpl_aio.yml diff --git a/6.4.0/apache/data/docker-compose.yml b/6.4.0/default/data/docker-compose.tpl_apache.yml similarity index 100% rename from 6.4.0/apache/data/docker-compose.yml rename to 6.4.0/default/data/docker-compose.tpl_apache.yml diff --git a/6.4.0/aio/data/logrotate.d/ampache b/6.4.0/default/data/logrotate.d/ampache similarity index 100% rename from 6.4.0/aio/data/logrotate.d/ampache rename to 6.4.0/default/data/logrotate.d/ampache diff --git a/6.4.0/aio/data/sites-enabled/001-ampache.conf b/6.4.0/default/data/sites-enabled/001-ampache.conf similarity index 100% rename from 6.4.0/aio/data/sites-enabled/001-ampache.conf rename to 6.4.0/default/data/sites-enabled/001-ampache.conf diff --git a/6.4.0/aio/data/supervisord/supervisord.conf b/6.4.0/default/data/supervisord/supervisord.tpl_aio.conf similarity index 100% rename from 6.4.0/aio/data/supervisord/supervisord.conf rename to 6.4.0/default/data/supervisord/supervisord.tpl_aio.conf diff --git a/6.4.0/apache/data/supervisord/supervisord.conf b/6.4.0/default/data/supervisord/supervisord.tpl_apache.conf similarity index 100% rename from 6.4.0/apache/data/supervisord/supervisord.conf rename to 6.4.0/default/data/supervisord/supervisord.tpl_apache.conf diff --git a/6.4.0/apache/Dockerfile b/6.4.0/nosql/Dockerfile similarity index 99% rename from 6.4.0/apache/Dockerfile rename to 6.4.0/nosql/Dockerfile index d425573..3fa1a55 100644 --- a/6.4.0/apache/Dockerfile +++ b/6.4.0/nosql/Dockerfile @@ -1,4 +1,4 @@ -# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian.template +# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian-nosql.template FROM debian:bookworm LABEL maintainer="lachlan-00" diff --git a/6.4.0/apache/data/apache2/php.ini b/6.4.0/nosql/data/apache2/php.ini similarity index 100% rename from 6.4.0/apache/data/apache2/php.ini rename to 6.4.0/nosql/data/apache2/php.ini diff --git a/6.4.0/apache/data/bin/ampache_cron.sh b/6.4.0/nosql/data/bin/ampache_cron.sh similarity index 100% rename from 6.4.0/apache/data/bin/ampache_cron.sh rename to 6.4.0/nosql/data/bin/ampache_cron.sh diff --git a/6.4.0/apache/data/bin/apache2.sh b/6.4.0/nosql/data/bin/apache2.sh similarity index 100% rename from 6.4.0/apache/data/bin/apache2.sh rename to 6.4.0/nosql/data/bin/apache2.sh diff --git a/6.5.0/aio/data/bin/create_mysql_admin_user.sh b/6.4.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh similarity index 100% rename from 6.5.0/aio/data/bin/create_mysql_admin_user.sh rename to 6.4.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh diff --git a/6.4.0/apache/data/bin/cron.sh b/6.4.0/nosql/data/bin/cron.sh similarity index 100% rename from 6.4.0/apache/data/bin/cron.sh rename to 6.4.0/nosql/data/bin/cron.sh diff --git a/6.4.0/apache/data/bin/docker-entrypoint.sh b/6.4.0/nosql/data/bin/docker-entrypoint.sh similarity index 100% rename from 6.4.0/apache/data/bin/docker-entrypoint.sh rename to 6.4.0/nosql/data/bin/docker-entrypoint.sh diff --git a/6.4.0/apache/data/bin/inotifywait.sh b/6.4.0/nosql/data/bin/inotifywait.sh similarity index 100% rename from 6.4.0/apache/data/bin/inotifywait.sh rename to 6.4.0/nosql/data/bin/inotifywait.sh diff --git a/6.5.0/aio/data/bin/mysql.sh b/6.4.0/nosql/data/bin/mysql.tpl_aio.sh similarity index 100% rename from 6.5.0/aio/data/bin/mysql.sh rename to 6.4.0/nosql/data/bin/mysql.tpl_aio.sh diff --git a/6.5.0/aio/data/bin/run.sh b/6.4.0/nosql/data/bin/run.tpl_aio.sh similarity index 100% rename from 6.5.0/aio/data/bin/run.sh rename to 6.4.0/nosql/data/bin/run.tpl_aio.sh diff --git a/6.5.0/apache/data/bin/run.sh b/6.4.0/nosql/data/bin/run.tpl_apache.sh similarity index 100% rename from 6.5.0/apache/data/bin/run.sh rename to 6.4.0/nosql/data/bin/run.tpl_apache.sh diff --git a/6.5.0/aio/data/docker-compose.yml b/6.4.0/nosql/data/docker-compose.tpl_aio.yml similarity index 100% rename from 6.5.0/aio/data/docker-compose.yml rename to 6.4.0/nosql/data/docker-compose.tpl_aio.yml diff --git a/6.5.0/apache/data/docker-compose.yml b/6.4.0/nosql/data/docker-compose.tpl_apache.yml similarity index 100% rename from 6.5.0/apache/data/docker-compose.yml rename to 6.4.0/nosql/data/docker-compose.tpl_apache.yml diff --git a/6.4.0/apache/data/logrotate.d/ampache b/6.4.0/nosql/data/logrotate.d/ampache similarity index 100% rename from 6.4.0/apache/data/logrotate.d/ampache rename to 6.4.0/nosql/data/logrotate.d/ampache diff --git a/6.4.0/apache/data/sites-enabled/001-ampache.conf b/6.4.0/nosql/data/sites-enabled/001-ampache.conf similarity index 100% rename from 6.4.0/apache/data/sites-enabled/001-ampache.conf rename to 6.4.0/nosql/data/sites-enabled/001-ampache.conf diff --git a/6.5.0/aio/data/supervisord/supervisord.conf b/6.4.0/nosql/data/supervisord/supervisord.tpl_aio.conf similarity index 100% rename from 6.5.0/aio/data/supervisord/supervisord.conf rename to 6.4.0/nosql/data/supervisord/supervisord.tpl_aio.conf diff --git a/6.5.0/apache/data/supervisord/supervisord.conf b/6.4.0/nosql/data/supervisord/supervisord.tpl_apache.conf similarity index 100% rename from 6.5.0/apache/data/supervisord/supervisord.conf rename to 6.4.0/nosql/data/supervisord/supervisord.tpl_apache.conf diff --git a/6.5.0/aio/Dockerfile b/6.5.0/default/Dockerfile similarity index 98% rename from 6.5.0/aio/Dockerfile rename to 6.5.0/default/Dockerfile index 08c3601..5435c89 100644 --- a/6.5.0/aio/Dockerfile +++ b/6.5.0/default/Dockerfile @@ -1,11 +1,11 @@ -# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian-aio.template +# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian.template FROM debian:bookworm LABEL maintainer="lachlan-00" ENV DEBIAN_FRONTEND=noninteractive ENV MYSQL_PASS **Random** ENV DISABLE_INOTIFYWAIT_CLEAN 0 -ARG VERSION=5.6.1 +ARG VERSION=bookworm RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/20230612T000000Z\nURIs: http://deb.debian.org/debian\nSuites: stable stable-updates\nComponents: main contrib non-free\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n\nTypes: deb\n# http://snapshot.debian.org/archive/debian-security/20230612T000000Z\nURIs: http://deb.debian.org/debian-security\nSuites: stable-security\nComponents: main\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n" > /etc/apt/sources.list.d/debian.sources' \ && apt-get -q -q update \ diff --git a/6.5.0/aio/data/apache2/php.ini b/6.5.0/default/data/apache2/php.ini similarity index 100% rename from 6.5.0/aio/data/apache2/php.ini rename to 6.5.0/default/data/apache2/php.ini diff --git a/6.5.0/aio/data/bin/ampache_cron.sh b/6.5.0/default/data/bin/ampache_cron.sh similarity index 100% rename from 6.5.0/aio/data/bin/ampache_cron.sh rename to 6.5.0/default/data/bin/ampache_cron.sh diff --git a/6.5.0/aio/data/bin/apache2.sh b/6.5.0/default/data/bin/apache2.sh similarity index 100% rename from 6.5.0/aio/data/bin/apache2.sh rename to 6.5.0/default/data/bin/apache2.sh diff --git a/6.5.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh b/6.5.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh new file mode 100755 index 0000000..82270ed --- /dev/null +++ b/6.5.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +mysqld_safe & +sleep 5 + +RET=1 +while [ $RET -ne 0 ]; do + echo "=> Waiting for confirmation of MySQL service startup" + sleep 5 + mysql -uroot -e "status" > /dev/null 2>&1 + RET=$? +done + +if [ "$MYSQL_PASS" = "**Random**" ]; then + unset MYSQL_PASS +fi + +PASS=${MYSQL_PASS:-$(pwgen -s 12 1)} +_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" ) +echo "=> Creating MySQL admin user with ${_word} password" + +mysql -uroot -e "CREATE USER 'admin'@'localhost' IDENTIFIED BY '$PASS'" +mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION" + + +echo "=> Done!" +echo "========================================================================" +echo "You can now connect to this MySQL Server using:" +echo "" +echo " mysql -uadmin -p$PASS -h -P" +echo "" +echo "Please remember to change the above password as soon as possible!" +echo "MySQL user 'root' has no password but only allows local connections" +echo "========================================================================" + +mysqladmin -uroot shutdown diff --git a/6.5.0/aio/data/bin/cron.sh b/6.5.0/default/data/bin/cron.sh similarity index 100% rename from 6.5.0/aio/data/bin/cron.sh rename to 6.5.0/default/data/bin/cron.sh diff --git a/6.5.0/aio/data/bin/docker-entrypoint.sh b/6.5.0/default/data/bin/docker-entrypoint.sh similarity index 100% rename from 6.5.0/aio/data/bin/docker-entrypoint.sh rename to 6.5.0/default/data/bin/docker-entrypoint.sh diff --git a/6.5.0/aio/data/bin/inotifywait.sh b/6.5.0/default/data/bin/inotifywait.sh similarity index 100% rename from 6.5.0/aio/data/bin/inotifywait.sh rename to 6.5.0/default/data/bin/inotifywait.sh diff --git a/6.5.0/default/data/bin/mysql.tpl_aio.sh b/6.5.0/default/data/bin/mysql.tpl_aio.sh new file mode 100755 index 0000000..7a64628 --- /dev/null +++ b/6.5.0/default/data/bin/mysql.tpl_aio.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec mysqld_safe --syslog diff --git a/6.5.0/default/data/bin/run.tpl_aio.sh b/6.5.0/default/data/bin/run.tpl_aio.sh new file mode 100755 index 0000000..fdf3052 --- /dev/null +++ b/6.5.0/default/data/bin/run.tpl_aio.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [[ ! -d /var/lib/mysql/mysql ]]; then + echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME" + echo "=> Installing MySQL ..." + mysql_install_db --auth-root-authentication-method=normal --user=mysql + echo "=> Done!" + create_mysql_admin_user.sh +else + echo "=> Using an existing volume of MySQL" +fi + +# Copy Ampache config .dist files +cp -p /var/tmp/*.dist /var/www/config/ + +# Start Supervisor to manage all the processes +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/6.5.0/default/data/bin/run.tpl_apache.sh b/6.5.0/default/data/bin/run.tpl_apache.sh new file mode 100644 index 0000000..15f9a95 --- /dev/null +++ b/6.5.0/default/data/bin/run.tpl_apache.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Copy Ampache config .dist files +cp -p /var/tmp/*.dist /var/www/config/ + +# Start Supervisor to manage all the processes +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/6.5.0/default/data/docker-compose.tpl_aio.yml b/6.5.0/default/data/docker-compose.tpl_aio.yml new file mode 100644 index 0000000..4dabe87 --- /dev/null +++ b/6.5.0/default/data/docker-compose.tpl_aio.yml @@ -0,0 +1,16 @@ +version: '3' + +services: + ampache: + image: ampache/ampache:latest + container_name: ampache + restart: unless-stopped + ports: + - 80:80 + volumes: + - ./data/config:/var/www/config + - ./data/log:/var/log/ampache + - ./data/media:/media + - ./data/mysql:/var/lib/mysql + environment: + DISABLE_INOTIFYWAIT_CLEAN: ${DISABLE_INOTIFYWAIT_CLEAN-0} diff --git a/6.5.0/default/data/docker-compose.tpl_apache.yml b/6.5.0/default/data/docker-compose.tpl_apache.yml new file mode 100644 index 0000000..5ed8029 --- /dev/null +++ b/6.5.0/default/data/docker-compose.tpl_apache.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + ampache: + image: ampache/ampache:nosql + container_name: ampache + restart: unless-stopped + ports: + - 80:80 + volumes: + - ./data/config:/var/www/config + - ./data/log:/var/log/ampache + - ./data/media:/media + environment: + DISABLE_INOTIFYWAIT_CLEAN: ${DISABLE_INOTIFYWAIT_CLEAN-0} diff --git a/6.5.0/aio/data/logrotate.d/ampache b/6.5.0/default/data/logrotate.d/ampache similarity index 100% rename from 6.5.0/aio/data/logrotate.d/ampache rename to 6.5.0/default/data/logrotate.d/ampache diff --git a/6.5.0/aio/data/sites-enabled/001-ampache.conf b/6.5.0/default/data/sites-enabled/001-ampache.conf similarity index 100% rename from 6.5.0/aio/data/sites-enabled/001-ampache.conf rename to 6.5.0/default/data/sites-enabled/001-ampache.conf diff --git a/6.5.0/default/data/supervisord/supervisord.tpl_aio.conf b/6.5.0/default/data/supervisord/supervisord.tpl_aio.conf new file mode 100644 index 0000000..d757d65 --- /dev/null +++ b/6.5.0/default/data/supervisord/supervisord.tpl_aio.conf @@ -0,0 +1,21 @@ +[supervisord] +nodaemon=true +user=root +loglevel=info +logfile=/var/log/supervisor/supervisord.log +pidfile=/tmp/supervisord.pid + +[program:cron] +command=cron.sh + +[program:mysql] +command=mysql.sh +stopwaitsecs=120 +stopasgroup=true +killasgroup=true + +[program:apache2] +command=apache2.sh + +[program:inotifywait] +command=inotifywait.sh diff --git a/6.5.0/default/data/supervisord/supervisord.tpl_apache.conf b/6.5.0/default/data/supervisord/supervisord.tpl_apache.conf new file mode 100644 index 0000000..36f1720 --- /dev/null +++ b/6.5.0/default/data/supervisord/supervisord.tpl_apache.conf @@ -0,0 +1,15 @@ +[supervisord] +nodaemon=true +user=root +loglevel=info +logfile=/var/log/supervisor/supervisord.log +pidfile=/tmp/supervisord.pid + +[program:cron] +command=cron.sh + +[program:apache2] +command=apache2.sh + +[program:inotifywait] +command=inotifywait.sh diff --git a/6.5.0/apache/Dockerfile b/6.5.0/nosql/Dockerfile similarity index 99% rename from 6.5.0/apache/Dockerfile rename to 6.5.0/nosql/Dockerfile index 223cd58..6fe691a 100644 --- a/6.5.0/apache/Dockerfile +++ b/6.5.0/nosql/Dockerfile @@ -1,4 +1,4 @@ -# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian.template +# DO NOT EDIT: created by update_maintainer_version from Dockerfile-debian-nosql.template FROM debian:bookworm LABEL maintainer="lachlan-00" diff --git a/6.5.0/apache/data/apache2/php.ini b/6.5.0/nosql/data/apache2/php.ini similarity index 100% rename from 6.5.0/apache/data/apache2/php.ini rename to 6.5.0/nosql/data/apache2/php.ini diff --git a/6.5.0/apache/data/bin/ampache_cron.sh b/6.5.0/nosql/data/bin/ampache_cron.sh similarity index 100% rename from 6.5.0/apache/data/bin/ampache_cron.sh rename to 6.5.0/nosql/data/bin/ampache_cron.sh diff --git a/6.5.0/apache/data/bin/apache2.sh b/6.5.0/nosql/data/bin/apache2.sh similarity index 100% rename from 6.5.0/apache/data/bin/apache2.sh rename to 6.5.0/nosql/data/bin/apache2.sh diff --git a/6.5.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh b/6.5.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh new file mode 100755 index 0000000..82270ed --- /dev/null +++ b/6.5.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +mysqld_safe & +sleep 5 + +RET=1 +while [ $RET -ne 0 ]; do + echo "=> Waiting for confirmation of MySQL service startup" + sleep 5 + mysql -uroot -e "status" > /dev/null 2>&1 + RET=$? +done + +if [ "$MYSQL_PASS" = "**Random**" ]; then + unset MYSQL_PASS +fi + +PASS=${MYSQL_PASS:-$(pwgen -s 12 1)} +_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" ) +echo "=> Creating MySQL admin user with ${_word} password" + +mysql -uroot -e "CREATE USER 'admin'@'localhost' IDENTIFIED BY '$PASS'" +mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION" + + +echo "=> Done!" +echo "========================================================================" +echo "You can now connect to this MySQL Server using:" +echo "" +echo " mysql -uadmin -p$PASS -h -P" +echo "" +echo "Please remember to change the above password as soon as possible!" +echo "MySQL user 'root' has no password but only allows local connections" +echo "========================================================================" + +mysqladmin -uroot shutdown diff --git a/6.5.0/apache/data/bin/cron.sh b/6.5.0/nosql/data/bin/cron.sh similarity index 100% rename from 6.5.0/apache/data/bin/cron.sh rename to 6.5.0/nosql/data/bin/cron.sh diff --git a/6.5.0/apache/data/bin/docker-entrypoint.sh b/6.5.0/nosql/data/bin/docker-entrypoint.sh similarity index 100% rename from 6.5.0/apache/data/bin/docker-entrypoint.sh rename to 6.5.0/nosql/data/bin/docker-entrypoint.sh diff --git a/6.5.0/apache/data/bin/inotifywait.sh b/6.5.0/nosql/data/bin/inotifywait.sh similarity index 100% rename from 6.5.0/apache/data/bin/inotifywait.sh rename to 6.5.0/nosql/data/bin/inotifywait.sh diff --git a/6.5.0/nosql/data/bin/mysql.tpl_aio.sh b/6.5.0/nosql/data/bin/mysql.tpl_aio.sh new file mode 100755 index 0000000..7a64628 --- /dev/null +++ b/6.5.0/nosql/data/bin/mysql.tpl_aio.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec mysqld_safe --syslog diff --git a/6.5.0/nosql/data/bin/run.tpl_aio.sh b/6.5.0/nosql/data/bin/run.tpl_aio.sh new file mode 100755 index 0000000..fdf3052 --- /dev/null +++ b/6.5.0/nosql/data/bin/run.tpl_aio.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [[ ! -d /var/lib/mysql/mysql ]]; then + echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME" + echo "=> Installing MySQL ..." + mysql_install_db --auth-root-authentication-method=normal --user=mysql + echo "=> Done!" + create_mysql_admin_user.sh +else + echo "=> Using an existing volume of MySQL" +fi + +# Copy Ampache config .dist files +cp -p /var/tmp/*.dist /var/www/config/ + +# Start Supervisor to manage all the processes +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/6.5.0/nosql/data/bin/run.tpl_apache.sh b/6.5.0/nosql/data/bin/run.tpl_apache.sh new file mode 100644 index 0000000..15f9a95 --- /dev/null +++ b/6.5.0/nosql/data/bin/run.tpl_apache.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Copy Ampache config .dist files +cp -p /var/tmp/*.dist /var/www/config/ + +# Start Supervisor to manage all the processes +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/6.5.0/nosql/data/docker-compose.tpl_aio.yml b/6.5.0/nosql/data/docker-compose.tpl_aio.yml new file mode 100644 index 0000000..4dabe87 --- /dev/null +++ b/6.5.0/nosql/data/docker-compose.tpl_aio.yml @@ -0,0 +1,16 @@ +version: '3' + +services: + ampache: + image: ampache/ampache:latest + container_name: ampache + restart: unless-stopped + ports: + - 80:80 + volumes: + - ./data/config:/var/www/config + - ./data/log:/var/log/ampache + - ./data/media:/media + - ./data/mysql:/var/lib/mysql + environment: + DISABLE_INOTIFYWAIT_CLEAN: ${DISABLE_INOTIFYWAIT_CLEAN-0} diff --git a/6.5.0/nosql/data/docker-compose.tpl_apache.yml b/6.5.0/nosql/data/docker-compose.tpl_apache.yml new file mode 100644 index 0000000..5ed8029 --- /dev/null +++ b/6.5.0/nosql/data/docker-compose.tpl_apache.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + ampache: + image: ampache/ampache:nosql + container_name: ampache + restart: unless-stopped + ports: + - 80:80 + volumes: + - ./data/config:/var/www/config + - ./data/log:/var/log/ampache + - ./data/media:/media + environment: + DISABLE_INOTIFYWAIT_CLEAN: ${DISABLE_INOTIFYWAIT_CLEAN-0} diff --git a/6.5.0/apache/data/logrotate.d/ampache b/6.5.0/nosql/data/logrotate.d/ampache similarity index 100% rename from 6.5.0/apache/data/logrotate.d/ampache rename to 6.5.0/nosql/data/logrotate.d/ampache diff --git a/6.5.0/apache/data/sites-enabled/001-ampache.conf b/6.5.0/nosql/data/sites-enabled/001-ampache.conf similarity index 100% rename from 6.5.0/apache/data/sites-enabled/001-ampache.conf rename to 6.5.0/nosql/data/sites-enabled/001-ampache.conf diff --git a/6.5.0/nosql/data/supervisord/supervisord.tpl_aio.conf b/6.5.0/nosql/data/supervisord/supervisord.tpl_aio.conf new file mode 100644 index 0000000..d757d65 --- /dev/null +++ b/6.5.0/nosql/data/supervisord/supervisord.tpl_aio.conf @@ -0,0 +1,21 @@ +[supervisord] +nodaemon=true +user=root +loglevel=info +logfile=/var/log/supervisor/supervisord.log +pidfile=/tmp/supervisord.pid + +[program:cron] +command=cron.sh + +[program:mysql] +command=mysql.sh +stopwaitsecs=120 +stopasgroup=true +killasgroup=true + +[program:apache2] +command=apache2.sh + +[program:inotifywait] +command=inotifywait.sh diff --git a/6.5.0/nosql/data/supervisord/supervisord.tpl_apache.conf b/6.5.0/nosql/data/supervisord/supervisord.tpl_apache.conf new file mode 100644 index 0000000..36f1720 --- /dev/null +++ b/6.5.0/nosql/data/supervisord/supervisord.tpl_apache.conf @@ -0,0 +1,15 @@ +[supervisord] +nodaemon=true +user=root +loglevel=info +logfile=/var/log/supervisor/supervisord.log +pidfile=/tmp/supervisord.pid + +[program:cron] +command=cron.sh + +[program:apache2] +command=apache2.sh + +[program:inotifywait] +command=inotifywait.sh diff --git a/Dockerfile-debian-aio.template b/Dockerfile-debian-nosql.template similarity index 89% rename from Dockerfile-debian-aio.template rename to Dockerfile-debian-nosql.template index 5b706cc..b641747 100644 --- a/Dockerfile-debian-aio.template +++ b/Dockerfile-debian-nosql.template @@ -2,9 +2,8 @@ FROM debian:%%DEBIAN_VERSION%% LABEL maintainer="lachlan-00" ENV DEBIAN_FRONTEND=noninteractive -ENV MYSQL_PASS **Random** ENV DISABLE_INOTIFYWAIT_CLEAN 0 -ARG VERSION=5.6.1 +ARG VERSION=%%AMPACHE_VERSION%% RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/20230612T000000Z\nURIs: http://deb.debian.org/debian\nSuites: stable stable-updates\nComponents: main contrib non-free\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n\nTypes: deb\n# http://snapshot.debian.org/archive/debian-security/20230612T000000Z\nURIs: http://deb.debian.org/debian-security\nSuites: stable-security\nComponents: main\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n" > /etc/apt/sources.list.d/debian.sources' \ && apt-get -q -q update \ @@ -30,7 +29,6 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 libvpx-dev \ locales \ logrotate \ - mariadb-server \ php%%PHP_VERSION%% \ php%%PHP_VERSION%%-curl \ php%%PHP_VERSION%%-gd \ @@ -44,9 +42,7 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 vorbis-tools \ zip \ unzip \ - && rm -rf /var/lib/mysql/* /var/www /etc/apache2/sites-enabled/* /var/lib/apt/lists/* \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql /var/run/mysqld \ + && rm -rf /var/www/* /etc/apache2/sites-enabled/* /var/lib/apt/lists/* \ && mkdir -p /var/log/ampache \ && chown -R www-data:www-data /var/log/ampache \ && ln -s /etc/apache2/sites-available/001-ampache.conf /etc/apache2/sites-enabled/ \ @@ -70,12 +66,13 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 lsb-release \ software-properties-common \ unzip \ + wget \ && apt-get -qq autoremove -VOLUME ["/etc/mysql", "/var/lib/mysql", "/var/www/config"] +VOLUME ["/var/www/config"] EXPOSE 80 -COPY data/bin/run.sh data/bin/inotifywait.sh data/bin/cron.sh data/bin/apache2.sh data/bin/mysql.sh data/bin/create_mysql_admin_user.sh data/bin/ampache_cron.sh data/bin/docker-entrypoint.sh /usr/local/bin/ +COPY data/bin/run.sh data/bin/inotifywait.sh data/bin/cron.sh data/bin/apache2.sh data/bin/ampache_cron.sh data/bin/docker-entrypoint.sh /usr/local/bin/ COPY data/sites-enabled/001-ampache.conf /etc/apache2/sites-available/ COPY data/apache2/php.ini /etc/php/%%PHP_VERSION%%/apache2/ COPY data/logrotate.d/* /etc/logrotate.d/ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index a99456c..83e0a9c 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -2,8 +2,9 @@ FROM debian:%%DEBIAN_VERSION%% LABEL maintainer="lachlan-00" ENV DEBIAN_FRONTEND=noninteractive +ENV MYSQL_PASS **Random** ENV DISABLE_INOTIFYWAIT_CLEAN 0 -ARG VERSION=5.6.1 +ARG VERSION=%%AMPACHE_VERSION%% RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/20230612T000000Z\nURIs: http://deb.debian.org/debian\nSuites: stable stable-updates\nComponents: main contrib non-free\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n\nTypes: deb\n# http://snapshot.debian.org/archive/debian-security/20230612T000000Z\nURIs: http://deb.debian.org/debian-security\nSuites: stable-security\nComponents: main\nSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg\n" > /etc/apt/sources.list.d/debian.sources' \ && apt-get -q -q update \ @@ -29,6 +30,7 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 libvpx-dev \ locales \ logrotate \ + mariadb-server \ php%%PHP_VERSION%% \ php%%PHP_VERSION%%-curl \ php%%PHP_VERSION%%-gd \ @@ -42,7 +44,9 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 vorbis-tools \ zip \ unzip \ - && rm -rf /var/www/* /etc/apache2/sites-enabled/* /var/lib/apt/lists/* \ + && rm -rf /var/lib/mysql/* /var/www /etc/apache2/sites-enabled/* /var/lib/apt/lists/* \ + && mkdir -p /var/run/mysqld \ + && chown -R mysql /var/run/mysqld \ && mkdir -p /var/log/ampache \ && chown -R www-data:www-data /var/log/ampache \ && ln -s /etc/apache2/sites-available/001-ampache.conf /etc/apache2/sites-enabled/ \ @@ -66,13 +70,12 @@ RUN sh -c 'echo "Types: deb\n# http://snapshot.debian.org/archive/debian/202 lsb-release \ software-properties-common \ unzip \ - wget \ && apt-get -qq autoremove -VOLUME ["/var/www/config"] +VOLUME ["/etc/mysql", "/var/lib/mysql", "/var/www/config"] EXPOSE 80 -COPY data/bin/run.sh data/bin/inotifywait.sh data/bin/cron.sh data/bin/apache2.sh data/bin/ampache_cron.sh data/bin/docker-entrypoint.sh /usr/local/bin/ +COPY data/bin/run.sh data/bin/inotifywait.sh data/bin/cron.sh data/bin/apache2.sh data/bin/mysql.sh data/bin/create_mysql_admin_user.sh data/bin/ampache_cron.sh data/bin/docker-entrypoint.sh /usr/local/bin/ COPY data/sites-enabled/001-ampache.conf /etc/apache2/sites-available/ COPY data/apache2/php.ini /etc/php/%%PHP_VERSION%%/apache2/ COPY data/logrotate.d/* /etc/logrotate.d/ diff --git a/README.md b/README.md index 9edafa5..1fc550c 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ This is a modified version of the original repository and was inspired by [Nextc Docker versions generated by this repository have the tag naming convention, `/:[<-variant>]` and provide the creation of explicit image tags: -* `ampache:-aio`: The Ampache All-In-One solution offers easy deployment and maintenance by including all features in a single Docker instance, which is tied to a specific version from the Ampache Releases. -* `ampache:-apache`: The Ampache service that contains a full Ampache installation on an Apache Web Server with Cron. It is designed to use with external MySQL server. +* `ampache:`: The Ampache All-In-One solution offers easy deployment and maintenance by including all features in a single Docker instance, which is tied to a specific version from the Ampache Releases. +* `ampache:-nosql`: The Ampache service that contains a full Ampache installation on an Apache Web Server with Cron. It is designed to use with external MySQL server. ### Modifications and New Features @@ -17,7 +17,7 @@ Docker versions generated by this repository have the tag naming convention, `-aio` and `ampache:-apache` are used. These tags offer a clear and consistent versioning system, setting a pattern for future versioning, such as for fpm. This approach ensures clarity and consistency in version management. +* **Docker tag naming**: This refactoring follow the Docker tags defacto standard naming convention. Specifically, the tags `ampache:` and `ampache:-nosql` are used. These tags offer a clear and consistent versioning system, setting a pattern for future versioning, such as for fpm. This approach ensures clarity and consistency in version management. ## How to use this image diff --git a/update_maintained_versions.sh b/update_maintained_versions.sh old mode 100644 new mode 100755 index 59e77ee..102d8d6 --- a/update_maintained_versions.sh +++ b/update_maintained_versions.sh @@ -24,8 +24,8 @@ min_version='6.4' # All Possible Variant variants=( - aio - apache + default + nosql ) # Get All version of Ampache @@ -55,8 +55,8 @@ declare -A crontab_int=( ) declare -A base=( - [apache]='debian' - [aio]='debian-aio' + [default]='debian' + [nosql]='debian-nosql' ) # @@ -155,7 +155,7 @@ function create_variant() { local debianVersion=${debian_version[$version]-${debian_version[default]}} local phpVersion=${php_version[$version]-${php_version[default]}} local crontabInt=${crontab_int[$version]-${crontab_int[default]}} - local url="https://github.com/ampache/ampache/releases/download/${version}/ampache-${version}_all_php${phpVersion}.zip" + local url="https://github.com/ampache/ampache/releases/download/${version}/ampache-${version}_all_php${phpVersion}.zip" local ascUrl="https://github.com/ampache/ampache/releases/download/${version}/ampache-${version}_all_php${phpVersion}.zip.asc" @@ -170,6 +170,7 @@ function create_variant() { # Replace the variables. sed -ri -e ' s/%%DEBIAN_VERSION%%/'"$debianVersion"'/g; + s/%%AMPACHE_VERSION%%/'"$ampacheVersion"'/g; s/%%PHP_VERSION%%/'"$phpVersion"'/g; s/%%VARIANT%%/'"$variant"'/g; s/%%VERSION%%/'"$fullversion"'/g;