This commit is contained in:
2025-05-27 04:23:51 -05:00
parent f4bcf72b9b
commit 381f78b4e2
12 changed files with 282 additions and 79 deletions

View File

@ -24,39 +24,6 @@ services:
retries: 3
start_period: 30s
command: >
bash -c "
set -e
echo '[✔] Ensuring .env...'
if [ ! -f '.env' ]; then cp .env.example .env; fi
echo '[✔] Waiting for MySQL to be ready...'
until nc -z ${MYSQL_HOST} ${MYSQL_PORT}; do sleep 1; done
echo '[✔] Ensuring migration structure...'
if [ ! -d 'migrations' ]; then
echo '[] Running flask db init...'
flask db init
fi
echo '[] Autogenerating migration...'
flask db migrate -m 'auto' || echo '[] No changes detected.'
echo '[✔] Running DB migrations...'
flask db upgrade
if [ \"$ENABLE_DB_SEEDING\" = \"1\" ]; then
echo '[🌱] Seeding Data...'
flask preload-data
else
echo '[⚠️] DB seeding skipped by config.'
fi
echo '[🚀] Starting Flask server...'
flask run --host=0.0.0.0
"
db:
image: mysql:8