1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-20 21:31:32 +00:00

Check if mysql has been initialized before trying to upgrade

This commit is contained in:
FreddleSpl0it
2025-05-31 21:50:49 +02:00
parent 744aa5d137
commit 743bfcec60
3 changed files with 13 additions and 12 deletions

View File

@@ -10,6 +10,8 @@ class BootstrapMysql(BootstrapBase):
dbpass = os.getenv("MYSQL_ROOT_PASSWORD", "")
socket = "/tmp/mysql-temp.sock"
# Check if mysql has been initialized
if os.path.exists("/var/lib/mysql/mysql/db.frm"):
print("Starting temporary mysqld for upgrade...")
self.start_temporary(socket)

View File

@@ -7,7 +7,6 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
gosu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -17,4 +17,4 @@ if [ $BOOTSTRAP_EXIT_CODE -ne 0 ]; then
fi
echo "Bootstrap succeeded. Starting MariaDB..."
exec gosu mysql "$@"
exec /usr/local/bin/docker-entrypoint.sh "$@"