diff options
author | 2018-09-21 21:15:34 +0200 | |
---|---|---|
committer | 2018-09-21 21:15:34 +0200 | |
commit | d6bbff585d682266d2c71b2e478ea472dc8cbb2b (patch) | |
tree | 15fa55955c17f00479bae5c93f93f95f938f192a /docker | |
parent | Use UWSGI protocol. (diff) |
Set up graceful shutdown.
Diffstat (limited to 'docker')
-rw-r--r-- | docker/app/alpine/3.6/Dockerfile | 1 | ||||
-rw-r--r-- | docker/app/alpine/3.7/Dockerfile | 1 | ||||
-rw-r--r-- | docker/app/stretch/3.6/Dockerfile | 1 | ||||
-rw-r--r-- | docker/app/stretch/3.7/Dockerfile | 1 | ||||
-rw-r--r-- | docker/app/uwsgi.ini | 27 |
5 files changed, 26 insertions, 5 deletions
diff --git a/docker/app/alpine/3.6/Dockerfile b/docker/app/alpine/3.6/Dockerfile index af40b9d1..b9cb557b 100644 --- a/docker/app/alpine/3.6/Dockerfile +++ b/docker/app/alpine/3.6/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.6-alpine +STOPSIGNAL SIGQUIT ARG EXTRAS=deploy RUN adduser \ diff --git a/docker/app/alpine/3.7/Dockerfile b/docker/app/alpine/3.7/Dockerfile index a2852d0d..4a8b5b34 100644 --- a/docker/app/alpine/3.7/Dockerfile +++ b/docker/app/alpine/3.7/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.7-alpine +STOPSIGNAL SIGQUIT ARG EXTRAS=deploy RUN adduser \ diff --git a/docker/app/stretch/3.6/Dockerfile b/docker/app/stretch/3.6/Dockerfile index 41e50ed9..8a37925c 100644 --- a/docker/app/stretch/3.6/Dockerfile +++ b/docker/app/stretch/3.6/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.6-stretch +STOPSIGNAL SIGQUIT ARG EXTRAS=deploy RUN adduser \ diff --git a/docker/app/stretch/3.7/Dockerfile b/docker/app/stretch/3.7/Dockerfile index 7cc8f6ad..1674eece 100644 --- a/docker/app/stretch/3.7/Dockerfile +++ b/docker/app/stretch/3.7/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.7-stretch +STOPSIGNAL SIGQUIT ARG EXTRAS=deploy RUN adduser \ diff --git a/docker/app/uwsgi.ini b/docker/app/uwsgi.ini index 70a39921..eb5b4ec2 100644 --- a/docker/app/uwsgi.ini +++ b/docker/app/uwsgi.ini @@ -1,17 +1,34 @@ [uwsgi] -# Exposed ports +### Exposed ports +# uWSGI protocol socket socket = :4000 -# File settings +### File settings +# WSGI application wsgi = pysite.wsgi:application +# Directory to move into at startup chdir = /app -# Concurrency options +### Concurrency options +# Run a master to supervise the workers master = true -threads = 2 +# Keep a minimum of 1 worker +cheaper = 1 +# Allow a maximum of 4 workers +workers = 4 +# Check how busy our workers are every 10 seconds +cheaper-overload = 10 +# Automatically set up meanginful process names auto-procname = true +# Prefix process names with `pysite : ` procname-prefix-spaced = pysite : -# Startup settings +### Startup settings +# Exit if we can't load the app need-app = true +# `setuid` to an unprivileged user uid = 1500 + +### Hook setup +# Gracefully kill workers on `SIGQUIT` +hook-master-start = unix_signal:3 gracefully_kill_them_all |