aboutsummaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
author0livd <github@destras.fr>2018-02-07 09:37:21 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2018-02-07 09:37:21 +0100
commitd9471733f82f948e4e77ac91d6280fa5c4856358 (patch)
tree13f6e8c7703759f38f7f9d39fcec3100f9fb11f5 /conf
parent667e555d6726f1e27e8e5cdcfb79981b413571e9 (diff)
downloadihatemoney-mirror-d9471733f82f948e4e77ac91d6280fa5c4856358.zip
ihatemoney-mirror-d9471733f82f948e4e77ac91d6280fa5c4856358.tar.gz
ihatemoney-mirror-d9471733f82f948e4e77ac91d6280fa5c4856358.tar.bz2
Fix some anti patterns in docker deployment (#321)
- Use exec to run gunicorn and avoid creating a new process. - Add the possibility to pass any additional parameters to gunicorn. - Use only one gunicorn worker by default as the usual way to scale the app in production would be to use the scale command of the cluster scheduler. Additional workers could still be added by passing the "-w" gunicorn parameter to docker run.
Diffstat (limited to 'conf')
-rwxr-xr-xconf/confandrun.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/conf/confandrun.sh b/conf/confandrun.sh
index e76a8e8..e37a573 100755
--- a/conf/confandrun.sh
+++ b/conf/confandrun.sh
@@ -17,7 +17,8 @@ ADMIN_PASSWORD = "$ADMIN_PASSWORD"
ALLOW_PUBLIC_PROJECT_CREATION = $ALLOW_PUBLIC_PROJECT_CREATION
ACTIVATE_ADMIN_DASHBOARD = $ACTIVATE_ADMIN_DASHBOARD
EOF
-gunicorn ihatemoney.wsgi:application \
--b 0.0.0.0:8000 \
---log-syslog \
--w "$GUNICORN_NUM_WORKERS"
+# Start gunicorn without forking
+exec gunicorn ihatemoney.wsgi:application \
+ -b 0.0.0.0:8000 \
+ --log-syslog \
+ "$@"