Skip to content

Commit 487a294

Browse files
authored
Optimise gunicorn options for running in docker. (#4700)
1 parent 8e98dc1 commit 487a294

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

docker/prod/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,8 @@ COPY --from=builder /opt/app/static /opt/app/static
6363
# Copy the project into the image
6464
COPY ./ ./
6565

66+
# Expose the port gunicorn is running on for other Docker containers.
67+
EXPOSE 8000
68+
6669
# Run entrypoint.sh.
6770
ENTRYPOINT ["/opt/app/docker/prod/entrypoint.sh"]

docker/prod/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ python manage.py clear_cache --cache=default
77
python manage.py sync_roles
88

99
# Start gunicorn server.
10-
gunicorn hypha.wsgi:application --env DJANGO_SETTINGS_MODULE=hypha.settings.production --threads 3 --reload --bind 0.0.0.0:9001
10+
gunicorn hypha.wsgi:application --env DJANGO_SETTINGS_MODULE=hypha.settings.production --worker-tmp-dir /dev/shm --workers=2 --threads=4 --worker-class=gthread --bind 0.0.0.0:8000
1111

1212
exec "$@"

0 commit comments

Comments
 (0)