-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathstart.sh
executable file
·24 lines (21 loc) · 894 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# use path of this example as working directory; enables starting this script from anywhere
cd "$(dirname "$0")"
# create directory for user data
mkdir -p .user
if [ "$1" = "prd" ]; then
echo "Starting Uvicorn server in production mode..."
# Set nicegui storage path to avoid permission issues
if [ -z "$NICEGUI_STORAGE_PATH" ]; then
export NICEGUI_STORAGE_PATH=".user/.nicegui"
fi
# we also use a single worker in production mode so socket.io connections are always handled by the same worker
uvicorn beaverhabits.main:app --workers 1 --log-level info --port 8080 --host 0.0.0.0
elif [ "$1" = "dev" ]; then
echo "Starting Uvicorn server in development mode..."
# reload implies workers = 1
uvicorn beaverhabits.main:app --reload --port 9001 --host 0.0.0.0
else
echo "Invalid parameter. Use 'prod' or 'dev'."
exit 1
fi