It really needs fix_volumes.sh to be reliable

This commit is contained in:
eroncero
2025-08-05 10:47:35 +02:00
parent 49a4491d61
commit f1c348f974
4 changed files with 33 additions and 8 deletions

2
.env
View File

@@ -14,4 +14,4 @@ NGINX_HTTPS_IPV6_PORT=8843
NGINX_CONTAINER_HTTP_PORT=80
NGINX_CONTAINER_HTTPS_PORT=443
PHP_VERSIONS= # Set this without quotes! ex: 8.1 7.1 7.3
PHP_VERSIONS= # Set this without quotes! example: 8.1 7.1 7.3

12
del_vols.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
sudo rm -rfv nginx-srv/etc
sudo rm -rfv nginx-srv/var
sudo rm -rfv multi-php-fpm/etc
sudo rm -rfv multi-php-fpm/run
sudo rm -rfv mariadb-srv/run
sudo rm -rfv mariadb-srv/var
sudo rm -rfv mariadb-srv/etc
#

View File

@@ -1,9 +1,18 @@
#!/bin/sh
mkdir -p /etc/mysql # Creates /etc/php if it doesn't exist
mkdir -p /var/lib/mysql # Creates /etc/php if it doesn't exist
#mkdir -p /etc/mysql # Creates /etc/php if it doesn't exist
#mkdir -p /var/lib/mysql # Creates /etc/php if it doesn't exist
[ -d "/etc/mysql" ] || mkdir -p /etc/mysql
[ -d "/var/lib/mysql" ] || mkdir -p /var/lib/mysql
if [ ! -f /etc/mysql/my.cnf ]; then
cp -a /tmp/buildtime/etc/mysql/* /etc/mysql/
rm -rf /tmp/buildtime/etc/mysql/
fi
if [ "$(ls -A /var/lib/mysql)" ]; then
cp -a /tmp/buildtime/var/lib/mysql/* /var/lib/mysql #&& rm -rf /tmp/buildtime/var/lib/mysql
fi
mv /tmp/buildtime/etc/mysql/* /etc/mysql/
mv /tmp/buildtime/var/lib/mysql/* /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:root /run/mysqld

View File

@@ -7,11 +7,15 @@ for file in /etc/nginx/sites-available/*.conf; do
done
rm /etc/nginx/sites-enabled/*.conf
mv /tmp/buildtime/default /etc/nginx/sites-available/default
mv /tmp/buildtime/letsencrypt/* /etc/letsencrypt
mv /tmp/buildtime/www/* /var/www/
if [ "$(ls -A /etc/letsencrypt)" ]; then
mv /tmp/buildtime/letsencrypt/* /etc/letsencrypt
fi
# One-liner with test
cp -a /tmp/buildtime/www/html* /var/www/html && rm -rf /tmp/buildtime/www/html
chown -R www-data:www-data /var/www
service nginx start