Files
WebTech/docker-entrypoint.sh
2025-04-21 14:12:12 +02:00

14 lines
329 B
Bash

#!/bin/bash
# Wait for DB to be ready (optional step)
# ./wait-for-it.sh db:5432 --timeout=30 -- echo "DB is up"
# Only run flask db init if migrations folder doesn't exist
if [ -d "migrations" ] && [ -z "$(ls -A migrations)" ]; then
flask db init
fi
flask db migrate -m "Autogenerated migration"
flask db upgrade
exec "$@"