-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
45 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
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,31 @@ | ||
#!/bin/sh -e | ||
|
||
|
||
export MEDIA_ROOT="${MEDIA_ROOT:-/var/run/app/media}" | ||
export STATIC_ROOT="${STATIC_ROOT:-/var/run/app/static}" | ||
export UWSGI_PROCESSES="${UWSGI_PROCESSES:-"4"}" | ||
export DJANGO_SETTINGS_MODULE="${DJANGO_SETTINGS_MODULE:-"country_workspace.config.settings"}" | ||
|
||
case "$1" in | ||
run) | ||
django-admin upgrade --with-check | ||
set -- tini -- "$@" | ||
MAPPING="" | ||
if [ "${STATIC_URL}" = "/static/" ]; then | ||
MAPPING="--static-map ${STATIC_URL}=${STATIC_ROOT}" | ||
fi | ||
uwsgi --http :8000 \ | ||
--module country_workspace.config.wsgi \ | ||
--uid user \ | ||
--gid app \ | ||
$MAPPING | ||
;; | ||
worker) | ||
exec celery -A country_workspace.celery worker -E --loglevel=ERROR --concurrency=4 | ||
;; | ||
beat) | ||
exec celery -A country_workspace.celery beat -E --loglevel=ERROR ---scheduler django_celery_beat.schedulers:DatabaseScheduler | ||
;; | ||
esac | ||
|
||
exec "$@" |