update run script

This commit is contained in:
hay-kot 2021-04-05 18:45:23 -08:00
commit ac362b5692

View file

@ -1,14 +1,30 @@
#!/bin/sh
# Initialize Database Prerun
python mealie/db/init_db.py
python mealie/services/image/minify.py
# Get Reload Arg `run.sh reload` for dev server
ARG1=${1:-production}
## Migrations
# Set Script Directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# # Initialize Database Prerun
poetry run python $DIR/db/init_db.py
poetry run python $DIR/services/image/minify.py
# Migrations
# TODO
## Web Server
if [[ "$ARG1" = "reload" ]]
then
echo "Hot Reload!"
# Start API
uvicorn mealie.app:app --host 0.0.0.0 --port 9000 --reload
else
echo "Production"
# Web Server
caddy start --config ./Caddyfile
# Start API
uvicorn mealie.app:app --host 0.0.0.0 --port 9000
fi