mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-06-05 16:43:12 +00:00
Switch to Postgres database
This commit is contained in:
parent
fda3fcc28c
commit
5248ae0123
6 changed files with 67 additions and 19 deletions
19
Highscore-Server/highscore/run.sh
Normal file
19
Highscore-Server/highscore/run.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
until pg_isready -d $DB_NAME -h $DB_HOST -p $DB_PORT -U $DB_USER
|
||||
do
|
||||
echo "Waiting for database to start... (5s)"
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "Database is ready! Creating tables..."
|
||||
flask --app server db init
|
||||
|
||||
if [ -n flask --app server db check ]; then
|
||||
echo "Database changes detected! Migrating..."
|
||||
flask --app server db migrate
|
||||
flask --app server db upgrade
|
||||
fi
|
||||
|
||||
echo "Starting server..."
|
||||
gunicorn --bind highscore:8080 server:app
|
Loading…
Add table
Add a link
Reference in a new issue