This commit is contained in:
2025-05-18 01:00:52 -05:00
parent 2e2997afb6
commit b572dfe002
4 changed files with 29 additions and 5 deletions

View File

@ -18,9 +18,9 @@ services:
depends_on:
- db
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 30s
timeout: 10s
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 10s
timeout: 5s
retries: 5
command: >
bash -c "
@ -32,6 +32,12 @@ services:
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.'
@ -49,6 +55,7 @@ services:
flask run --host=0.0.0.0
"
db:
image: mysql:8
restart: unless-stopped