-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker script to run `alembic upgrade head` before running application. Will be useful for making CI work when changes to Data Structures are needed.
- Loading branch information
Showing
3 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ __pycache__ | |
venv/ | ||
.venv | ||
.vscode | ||
env | ||
env | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# rald-server startup script | ||
|
||
check_env_variable() { | ||
if [ -z $1 ]; then | ||
echo "$2 environment variable not set"; | ||
exit 1 | ||
fi | ||
echo "$2 -> $1" | ||
} | ||
|
||
echo "staring up rald-server..." | ||
|
||
echo "Checking environment variales:" | ||
check_env_variable $BIND_INTERFACE "BIND_INTERFACE" | ||
check_env_variable $CONTAINER_PORT "CONTAINER_PORT" | ||
check_env_variable $GRACEFUL_TIMEOUT "GRACEFUL_TIMEOUT" | ||
check_env_variable $TIMEOUT "TIMEOUT" | ||
check_env_variable $WORKER_CONNECTIONS "WORKER_CONNECTIONS" | ||
check_env_variable $WORKERS "WORKERS" | ||
|
||
cd /app | ||
alembic upgrade head | ||
gunicorn --bind ${BIND_INTERFACE}:${CONTAINER_PORT} --graceful-timeout ${GRACEFUL_TIMEOUT} --timeout ${TIMEOUT} --worker-class=uvicorn.workers.UvicornWorker --worker-connections ${WORKER_CONNECTIONS} --workers ${WORKERS} wsgi-service:app |