forked from immuni-app/immuni-backend-exposure-reporting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·21 lines (19 loc) · 776 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·21 lines (19 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
set -eu
API_HOST=0.0.0.0
API_PORT=${API_PORT:-5000}
API_WORKERS=${API_WORKERS:-3}
API_WORKER_MAX_REQUESTS=${API_WORKER_MAX_REQUESTS:-10000}
case "$1" in
api) poetry run gunicorn immuni_exposure_reporting.sanic:sanic_app \
--access-logfile='-' \
--bind=${API_HOST}:${API_PORT} \
--logger-class=immuni_common.helpers.logging.CustomGunicornLogger \
--max-requests=${API_WORKER_MAX_REQUESTS} \
--workers=${API_WORKERS} \
--worker-class=uvicorn.workers.UvicornWorker ;;
debug) echo "Running in debug mode ..." \
&& tail -f /dev/null ;; # Allow entering the container to inspect the environment.
*) echo "Received unknown command $1 (allowed: api)"
exit 2 ;;
esac