pypiserver/docker
Matthew Planchard 8306de15db
Gunicorn/gevent docker, log fixes, cache busting (#371)
Updates the Docker configuration to use the gunicorn server with gevent
workers by default. Adds `waitress` to the docker container, so that if
no server is specified, we will fall back to that rather than `wsgiref`.

Making this happen brought a few other issues to light, which are also
addressed here.

- Docker log output not immediately being flushed to stdout (#358):
  resolved by setting the `PYTHONUNBUFFERED` env var to `t` in the
  docker container
- When the WSGIRef server is selected, its access logs are written
  directly to stderr, rather than going through the logging machinery:
  resolved by adding a new `WsgiHandler` class and passing in to
  bottle's `run()` method when running the wsgi server. This required a
  new `ServerCheck` class to determine whether the wsgi server is
  selected when the `auto` option is used
- When using `gunicorn` along with the watchdog cache, package uplaods
  were not being picked up by the watcher. Updated the `add_package`
  and `remove_package` methods on the `CachingFileBackend` to bust the
  cache
2021-02-07 17:04:06 -06:00
..
README.md Docker improvements (#365) 2021-02-06 11:28:15 -06:00
docker-requirements.txt Gunicorn/gevent docker, log fixes, cache busting (#371) 2021-02-07 17:04:06 -06:00
entrypoint.sh Gunicorn/gevent docker, log fixes, cache busting (#371) 2021-02-07 17:04:06 -06:00
gunicorn.conf.py Gunicorn/gevent docker, log fixes, cache busting (#371) 2021-02-07 17:04:06 -06:00
test_docker.py Gunicorn/gevent docker, log fixes, cache busting (#371) 2021-02-07 17:04:06 -06:00

README.md

Docker Resources and Tests

This directory contains resources and tests for the docker image.

Note that for these tests to run, the pytest process must be able to run docker. If you are on a system where that requires sudo, you will need to run the tests with sudo.

Tests are here rather than in /tests because there's no reason to run these tests as part of the usual tox process, which is run in CI against every supported Python version. We only need to run the Docker tests once.