Browse Source
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 cachepull/375/head


11 changed files with 334 additions and 55 deletions
@ -1,3 +1,11 @@
|
||||
passlib==1.7.2 |
||||
bcrypt==3.1.7 |
||||
watchdog==0.10.3 |
||||
# We use gunicorn as the default server in the docker container, with gevent |
||||
# workers |
||||
gevent==21.1.2 |
||||
gunicorn==20.0.4 |
||||
passlib==1.7.4 |
||||
bcrypt==3.2.0 |
||||
# If a user overrides args but does not override the server arg, we fall back to |
||||
# whatever bottle chooses as a default. Since the wsgiref server is not |
||||
# production-ready, install waitress as a fallback for these cases. |
||||
waitress==1.4.4 |
||||
watchdog==1.0.2 |
||||
|
@ -0,0 +1,14 @@
|
||||
"""Default gunicorn config for the docker environment. |
||||
|
||||
To override, mount a new gunicorn config at /data/gunicorn.conf.py in your |
||||
Docker container. |
||||
""" |
||||
|
||||
# pylint: disable=invalid-name |
||||
|
||||
# Enable to log every request |
||||
# accesslog = "-" |
||||
errorlog = "-" |
||||
preload_app = True |
||||
workers = 1 |
||||
worker_class = "gevent" |
Loading…
Reference in new issue