Skip to content

Commit

Permalink
Uses gunicorn WSGI server for development environment.
Browse files Browse the repository at this point in the history
It appears that there are strange interactions when running uWSGI with
the python-auto-reload option on Docker Engine 23.

When code changes are detected and the worker(s) are reloaded, traffic
between the proxy and application container appears to hang and the
processes representing the application containers continue to consume
100% of CPU resources.

Superficially, it appears this issue is related to seccomp changes
released in Docker Engine 23 and backported to Docker Engine 20 (though
subsequenctly reverted).

Refs: https://stackoverflow.com/questions/75511524/nginxuwsgi-stops-responding-after-auto-reload
Refs: https://docs.docker.com/engine/release-notes/23.0/
Refs: moby/moby#44563
Refs: moby/moby#44712
  • Loading branch information
thomlinton committed Jan 31, 2024
1 parent ca569b8 commit edd0e7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
12 changes: 1 addition & 11 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ fi
if [[ ${APP_SERVICE} == "wsgi" ]]; then
if [[ ${EMCEE_CMD_ENV} == "docker" ]]; then
${APP_ENV}/bin/pip install -r /app/docker/requirements-dev.txt
${APP_ENV}/bin/uwsgi \
--module oregoninvasiveshotline.wsgi \
--static-map /static=/static \
--static-map /media=/media \
--http-socket :8000 \
--http-auto-chunked \
--http-keepalive \
--ignore-sigpipe \
--ignore-write-errors \
--disable-write-exception \
--python-auto-reload 0
${APP_ENV}/bin/gunicorn -b 0.0.0.0:8000 --reload oregoninvasiveshotline.wsgi
else
exec ${APP_ENV}/bin/uwsgi --include /uwsgi/uwsgi.ini
fi
Expand Down
1 change: 1 addition & 0 deletions oregoninvasiveshotline/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

if settings.DEBUG: # pragma: no cover
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static('htmlcov', document_root='htmlcov', show_indexes=True)


Expand Down

0 comments on commit edd0e7d

Please sign in to comment.