Docker buid issue
This commit is contained in:
@ -47,7 +47,21 @@ services:
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
command: >
|
||||
sh -c "python seed_user.py && gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 run:app"
|
||||
sh -c "
|
||||
echo '⏳ Waiting for MySQL to be ready for connections...'
|
||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
||||
if mysql -h db -u vendinguser -pvendingpass -e 'SELECT 1' >/dev/null 2>&1; then
|
||||
echo '✓ MySQL is ready!'
|
||||
break
|
||||
fi
|
||||
echo 'Waiting for MySQL... (attempt' $$i'/15)'
|
||||
sleep 3
|
||||
done
|
||||
echo '🌱 Running database seed script...'
|
||||
python seed_user.py
|
||||
echo '🚀 Starting Gunicorn server...'
|
||||
gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 run:app
|
||||
"
|
||||
|
||||
frontend:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user