Add base template and unuasble style

This commit is contained in:
Michał Gdula 2023-05-05 02:11:10 +03:00
parent 8bf194f936
commit 0af071992b
10 changed files with 94 additions and 53 deletions

View file

@ -0,0 +1,29 @@
#!/bin/sh
# Wait for database to start
until pg_isready -d $DB_NAME -h $DB_HOST -U $DB_USER
do
echo "Waiting for database to start... (5s)"
sleep 5
done
echo "Database is ready!"
# Check if migrastions folder exists
if [ ! -d "/data/storage/migrations" ];
then
echo "Creating tables..."
flask --app server db init
fi
# Check if there are any changes to the database
if $(flask --app server db check);
then
echo "Database changes detected! Migrating..."
flask --app server db migrate
flask --app server db upgrade
fi
# Start server!!!!
echo "Starting server..."
gunicorn --bind highscore:8080 server:app