Fix all command syntax issues for Portainer compatibility

- Convert MySQL command args from folded scalar to array format
- Convert multiline script commands to Portainer-compatible syntax
- Remove nested quoted strings that cause YAML parsing errors
This commit is contained in:
Deckard
2025-09-27 03:28:09 -04:00
parent 6d15bcef6f
commit 6787cf863e

View File

@@ -18,13 +18,13 @@ services:
- "${DOCKER_DB_EXTERNAL_PORT:-64306}:3306" - "${DOCKER_DB_EXTERNAL_PORT:-64306}:3306"
volumes: volumes:
- ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/mysql}${STORAGE_PATH_CONTAINERS:-ac_mysql_data}:/var/lib/mysql - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/mysql}${STORAGE_PATH_CONTAINERS:-ac_mysql_data}:/var/lib/mysql
command: > command:
--default-authentication-plugin=mysql_native_password - --default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4 - --character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci - --collation-server=utf8mb4_unicode_ci
--max_connections=1000 - --max_connections=1000
--innodb-buffer-pool-size=256M - --innodb-buffer-pool-size=256M
--innodb-log-file-size=64M - --innodb-log-file-size=64M
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${DOCKER_DB_ROOT_PASSWORD:-password}"] test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${DOCKER_DB_ROOT_PASSWORD:-password}"]
@@ -46,17 +46,18 @@ services:
- azerothcore - azerothcore
environment: environment:
MYSQL_PWD: ${DOCKER_DB_ROOT_PASSWORD:-password} MYSQL_PWD: ${DOCKER_DB_ROOT_PASSWORD:-password}
command: | command:
sh -c ' - sh
echo "Creating AzerothCore databases..." - -c
mysql -h ac-mysql -uroot -e " - |
CREATE DATABASE IF NOT EXISTS acore_auth DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; echo "Creating AzerothCore databases..."
CREATE DATABASE IF NOT EXISTS acore_world DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; mysql -h ac-mysql -uroot -e "
CREATE DATABASE IF NOT EXISTS acore_characters DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS acore_auth DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SHOW DATABASES; CREATE DATABASE IF NOT EXISTS acore_world DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
" || true CREATE DATABASE IF NOT EXISTS acore_characters DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
echo "Databases created!" SHOW DATABASES;
' " || true
echo "Databases created!"
restart: "no" restart: "no"
# Step 3: Import AzerothCore database schema and data # Step 3: Import AzerothCore database schema and data
@@ -83,27 +84,26 @@ services:
AC_LOGGER_SERVER_CONFIG: "1,Console" AC_LOGGER_SERVER_CONFIG: "1,Console"
AC_APPENDER_CONSOLE_CONFIG: "1,2,0" AC_APPENDER_CONSOLE_CONFIG: "1,2,0"
entrypoint: ["/bin/bash", "-c"] entrypoint: ["/bin/bash", "-c"]
command: | command:
" - |
echo 'Waiting for databases to be ready...' echo 'Waiting for databases to be ready...'
sleep 10 sleep 10
echo 'Creating config file for dbimport...' echo 'Creating config file for dbimport...'
mkdir -p /azerothcore/env/dist/etc mkdir -p /azerothcore/env/dist/etc
cat > /azerothcore/env/dist/etc/dbimport.conf <<EOF cat > /azerothcore/env/dist/etc/dbimport.conf <<EOF
LoginDatabaseInfo = \"ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth\" LoginDatabaseInfo = "ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth"
WorldDatabaseInfo = \"ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_world\" WorldDatabaseInfo = "ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_world"
CharacterDatabaseInfo = \"ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_characters\" CharacterDatabaseInfo = "ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_characters"
Updates.EnableDatabases = 7 Updates.EnableDatabases = 7
Updates.AutoSetup = 1 Updates.AutoSetup = 1
EOF EOF
echo 'Running database import...' echo 'Running database import...'
cd /azerothcore/env/dist/bin cd /azerothcore/env/dist/bin
./dbimport ./dbimport
echo 'Database import complete!' echo 'Database import complete!'
"
restart: "no" restart: "no"
# Step 4: Auth server # Step 4: Auth server
@@ -274,51 +274,50 @@ services:
- MODULE_INDIVIDUAL_PROGRESSION=${MODULE_INDIVIDUAL_PROGRESSION:-0} - MODULE_INDIVIDUAL_PROGRESSION=${MODULE_INDIVIDUAL_PROGRESSION:-0}
- DEPLOYMENT_MODE=${DEPLOYMENT_MODE:-local} - DEPLOYMENT_MODE=${DEPLOYMENT_MODE:-local}
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: | command:
" - |
echo 'Initializing module management...' echo 'Initializing module management...'
cd /modules cd /modules
if [ \"$DEPLOYMENT_MODE\" = \"portainer\" ]; then if [ "$DEPLOYMENT_MODE" = "portainer" ]; then
echo 'Simple module setup for Portainer deployment...' echo 'Simple module setup for Portainer deployment...'
mkdir -p mod-playerbots mkdir -p mod-playerbots
echo '✅ Playerbot module directory created' echo '✅ Playerbot module directory created'
else else
echo 'Advanced module setup for local development...' echo 'Advanced module setup for local development...'
# Install Playerbots if enabled # Install Playerbots if enabled
if [ \"$$MODULE_PLAYERBOTS\" = \"1\" ] && [ ! -d \"mod-playerbots\" ]; then if [ "$MODULE_PLAYERBOTS" = "1" ] && [ ! -d "mod-playerbots" ]; then
echo 'Installing mod-playerbots...' echo 'Installing mod-playerbots...'
git clone https://github.com/liyunfan1223/mod-playerbots.git mod-playerbots git clone https://github.com/liyunfan1223/mod-playerbots.git mod-playerbots
fi
# Install AOE Loot if enabled
if [ "$MODULE_AOE_LOOT" = "1" ] && [ ! -d "mod-aoe-loot" ]; then
echo 'Installing mod-aoe-loot...'
git clone https://github.com/azerothcore/mod-aoe-loot.git mod-aoe-loot
fi
# Install Learn Spells if enabled
if [ "$MODULE_LEARN_SPELLS" = "1" ] && [ ! -d "mod-learn-spells" ]; then
echo 'Installing mod-learn-spells...'
git clone https://github.com/azerothcore/mod-learn-spells.git mod-learn-spells
fi
# Install Fireworks on Level if enabled
if [ "$MODULE_FIREWORKS" = "1" ] && [ ! -d "mod-fireworks-on-level" ]; then
echo 'Installing mod-fireworks-on-level...'
git clone https://github.com/azerothcore/mod-fireworks-on-level.git mod-fireworks-on-level
fi
# Install Individual Progression if enabled
if [ "$MODULE_INDIVIDUAL_PROGRESSION" = "1" ] && [ ! -d "mod-individual-progression" ]; then
echo 'Installing mod-individual-progression...'
git clone https://github.com/azerothcore/mod-individual-progression.git mod-individual-progression
fi
fi fi
# Install AOE Loot if enabled echo 'Module management complete. Keeping container alive...'
if [ \"$$MODULE_AOE_LOOT\" = \"1\" ] && [ ! -d \"mod-aoe-loot\" ]; then tail -f /dev/null
echo 'Installing mod-aoe-loot...'
git clone https://github.com/azerothcore/mod-aoe-loot.git mod-aoe-loot
fi
# Install Learn Spells if enabled
if [ \"$$MODULE_LEARN_SPELLS\" = \"1\" ] && [ ! -d \"mod-learn-spells\" ]; then
echo 'Installing mod-learn-spells...'
git clone https://github.com/azerothcore/mod-learn-spells.git mod-learn-spells
fi
# Install Fireworks on Level if enabled
if [ \"$$MODULE_FIREWORKS\" = \"1\" ] && [ ! -d \"mod-fireworks-on-level\" ]; then
echo 'Installing mod-fireworks-on-level...'
git clone https://github.com/azerothcore/mod-fireworks-on-level.git mod-fireworks-on-level
fi
# Install Individual Progression if enabled
if [ \"$$MODULE_INDIVIDUAL_PROGRESSION\" = \"1\" ] && [ ! -d \"mod-individual-progression\" ]; then
echo 'Installing mod-individual-progression...'
git clone https://github.com/azerothcore/mod-individual-progression.git mod-individual-progression
fi
fi
echo 'Module management complete. Keeping container alive...'
tail -f /dev/null
"
restart: "no" restart: "no"
networks: networks:
- azerothcore - azerothcore