Skip to content

Commit 82f11e6

Browse files
committed
fix: ensure MYSQL_ROOT_PASSWORD is set before MySQL configuration
1 parent d2c08e4 commit 82f11e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

assets/scripts/docker-entrypoint-prod.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
$(which chmod) 700 /etc/monit/monitrc
44

5-
# Check if MYSQL_ROOT_PASSWORD is set, if not use default
6-
MYSQL_DEFAULT_PASSWORD="defaultrootpassword"
7-
if [ -z "$MYSQL_ROOT_PASSWORD" ]; then
8-
echo "Error: MYSQL_ROOT_PASSWORD must be set."
9-
exit 1
10-
fi
11-
125
# Set MySQL root password if not already set
136
if [ ! -f /var/lib/mysql/.mysql_configured ]; then
7+
# Check if MYSQL_ROOT_PASSWORD is set, if not use default
8+
MYSQL_DEFAULT_PASSWORD="defaultrootpassword"
9+
if [ -z "$MYSQL_ROOT_PASSWORD" ]; then
10+
echo "Error: MYSQL_ROOT_PASSWORD must be set."
11+
exit 1
12+
fi
13+
1414
echo "Configuring MySQL for production..."
1515
/etc/init.d/mariadb start
1616
sleep 5

0 commit comments

Comments
 (0)