changes
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user