From 8a35557f08db46ae155640c4e32380f8eeeb7152 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sat, 25 May 2019 01:25:24 -0400 Subject: [PATCH] Use /dev/shm for worker-tmp-dir in gunicorn in Docker (#1003) * Use `/dev/shm` for `--worker-tmp-dir` in gunicorn in Docker --- docker-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 86e7988a..c2ff1aff 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,6 +5,7 @@ WORKERS=${WORKERS:-1} WORKER_CLASS=${WORKER_CLASS:-gevent} ACCESS_LOG=${ACCESS_LOG:--} ERROR_LOG=${ERROR_LOG:--} +WORKER_TEMP_DIR=${WORKER_TEMP_DIR:-/dev/shm} # Check that a .ctfd_secret_key file or SECRET_KEY envvar is set if [ ! -f .ctfd_secret_key ] && [ -z "$SECRET_KEY" ]; then @@ -41,6 +42,7 @@ echo "Starting CTFd" exec gunicorn 'CTFd:create_app()' \ --bind '0.0.0.0:8000' \ --workers $WORKERS \ + --worker-tmp-dir "$WORKER_TEMP_DIR" \ --worker-class "$WORKER_CLASS" \ --access-logfile "$ACCESS_LOG" \ --error-logfile "$ERROR_LOG"