Merge pull request #2 from jgkawell/db-with-volume

DB migrations from volume
This commit is contained in:
Nils Bergmann 2021-12-07 23:09:13 +01:00 committed by GitHub
commit 9b0ba22ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 13 deletions

View File

@ -11,6 +11,7 @@ services:
- MARIADB_DATABASE=${MARIADB_DATABASE:-darkflame} - MARIADB_DATABASE=${MARIADB_DATABASE:-darkflame}
volumes: volumes:
- database:/var/lib/mysql - database:/var/lib/mysql
- migrations/dlu:/docker-entrypoint-initdb.d
networks: networks:
- darkflame - darkflame

View File

@ -80,17 +80,6 @@ function fdb_to_sqlite() {
) )
} }
function run_db_migrations() {
(
cd /app/migrations/dlu
readarray -d '' entries < <(printf '%s\0' *.sql | sort -zV)
for entry in "${entries[@]}"; do
echo "Execute $entry"
mysql -h"$DATABASE_HOST" -P"$DATABASE_PORT" -u"$DATABASE_USER" -p"$DATABASE_PASSWORD" $DATABASE < $entry
done
)
}
set_defaults set_defaults
check_sql_connection check_sql_connection
@ -118,8 +107,6 @@ symlink_client_files
fdb_to_sqlite fdb_to_sqlite
run_db_migrations
echo "Start MasterServer" echo "Start MasterServer"
./MasterServer ./MasterServer