Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(app-server): change application server from uwsgi to gunicorn #569

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ USER document-merge-service
ENV PYTHONUNBUFFERED=1
ENV DJANGO_SETTINGS_MODULE document_merge_service.settings
ENV APP_HOME=/app
ENV UWSGI_INI /app/uwsgi.ini
ENV MEDIA_ROOT /var/lib/document-merge-service/media

ARG ENV=docker
Expand All @@ -32,4 +31,4 @@ COPY . $APP_HOME

EXPOSE 8000

CMD /bin/sh -c "poetry run python ./manage.py migrate && poetry run uwsgi"
CMD ./cmd.sh
5 changes: 5 additions & 0 deletions cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

GUNICORN_WORKERS="${GUNICORN_WORKERS:-8}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be documented in the README.md as well as docker-compose.yml.


poetry run gunicorn --workers=$GUNICORN_WORKERS --bind=0.0.0.0:8000 document_merge_service.wsgi:application
48 changes: 29 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ psycopg2-binary = "^2.9.5"
python-dateutil = "^2.8.2"
python-memcached = "^1.59"
requests = "^2.28.1"
uWSGI = "^2.0.21"
xltpl = "^0.16"
openpyxl = "^3.0.10"
gunicorn = "^20.1.0"

[tool.poetry.group.dev.dependencies]
black = "22.10.0"
Expand Down
71 changes: 0 additions & 71 deletions uwsgi.ini

This file was deleted.