diff --git a/Dockerfile b/Dockerfile index e2a7ce39..d8a9d3ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,13 @@ FROM ghcr.io/lsst-dm/prompt-base:${BASE_TAG} ENV PYTHONUNBUFFERED True ENV APP_HOME /app ENV PROMPT_PROCESSING_DIR $APP_HOME +# Normally defined in the Kubernetes config. +ENV WORKER_RESTART_FREQ ${WORKER_RESTART_FREQ:-0} ARG PORT WORKDIR $APP_HOME COPY python/activator activator/ COPY pipelines pipelines/ CMD source /opt/lsst/software/stack/loadLSST.bash \ && setup lsst_distrib \ - && exec gunicorn --bind :$PORT --workers 1 --threads 1 --timeout 0 activator.activator:app + && exec gunicorn --workers 1 --threads 1 --timeout 0 --max-requests $WORKER_RESTART_FREQ \ + --bind :$PORT activator.activator:app