Skip to content

Commit

Permalink
rename aio to default and apache to nosql
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed Jul 18, 2024
1 parent cbfb5aa commit ba929e7
Show file tree
Hide file tree
Showing 72 changed files with 288 additions and 27 deletions.
4 changes: 2 additions & 2 deletions 6.4.0/aio/Dockerfile → 6.4.0/default/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion 6.4.0/apache/Dockerfile → 6.4.0/nosql/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions 6.5.0/aio/Dockerfile → 6.5.0/default/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions 6.5.0/default/data/bin/create_mysql_admin_user.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -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<host> -P<port>"
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions 6.5.0/default/data/bin/mysql.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec mysqld_safe --syslog
17 changes: 17 additions & 0 deletions 6.5.0/default/data/bin/run.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions 6.5.0/default/data/bin/run.tpl_apache.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions 6.5.0/default/data/docker-compose.tpl_aio.yml
Original file line number Diff line number Diff line change
@@ -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}
15 changes: 15 additions & 0 deletions 6.5.0/default/data/docker-compose.tpl_apache.yml
Original file line number Diff line number Diff line change
@@ -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}
File renamed without changes.
21 changes: 21 additions & 0 deletions 6.5.0/default/data/supervisord/supervisord.tpl_aio.conf
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions 6.5.0/default/data/supervisord/supervisord.tpl_apache.conf
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion 6.5.0/apache/Dockerfile → 6.5.0/nosql/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions 6.5.0/nosql/data/bin/create_mysql_admin_user.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -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<host> -P<port>"
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions 6.5.0/nosql/data/bin/mysql.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec mysqld_safe --syslog
17 changes: 17 additions & 0 deletions 6.5.0/nosql/data/bin/run.tpl_aio.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions 6.5.0/nosql/data/bin/run.tpl_apache.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions 6.5.0/nosql/data/docker-compose.tpl_aio.yml
Original file line number Diff line number Diff line change
@@ -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}
15 changes: 15 additions & 0 deletions 6.5.0/nosql/data/docker-compose.tpl_apache.yml
Original file line number Diff line number Diff line change
@@ -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}
File renamed without changes.
21 changes: 21 additions & 0 deletions 6.5.0/nosql/data/supervisord/supervisord.tpl_aio.conf
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions 6.5.0/nosql/data/supervisord/supervisord.tpl_apache.conf
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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/ \
Expand All @@ -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/
Expand Down
Loading

0 comments on commit ba929e7

Please sign in to comment.