From ac362b5692ded03826e9c11419aa5f7ca1812940 Mon Sep 17 00:00:00 2001 From: hay-kot Date: Mon, 5 Apr 2021 18:45:23 -0800 Subject: [PATCH] update run script --- mealie/run.sh | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/mealie/run.sh b/mealie/run.sh index a6f5fc967..f453e5382 100755 --- a/mealie/run.sh +++ b/mealie/run.sh @@ -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 -caddy start --config ./Caddyfile +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 -# Start API -uvicorn mealie.app:app --host 0.0.0.0 --port 9000 \ No newline at end of file