feat(docker): rename web service to app, add nginx as web
Reorganize Docker Compose services: the Django/gunicorn container is now `app` and nginx is `web`, better reflecting their roles. Add a dedicated gunicorn configuration and install curl in the runtime image for health checks. Update documentation to reflect: - Neo4j migration from ariel.incus to a dedicated umbriel.incus instance - Rationale for requiring a dedicated Neo4j instance (single-tenancy assumptions, label/index isolation, schema ownership) - New service naming in compose commands and log tailing examples
This commit is contained in:
@@ -10,6 +10,7 @@ case "$1" in
|
||||
web)
|
||||
# Django REST API + admin (gunicorn → wsgi).
|
||||
exec gunicorn \
|
||||
--config /app/docker/gunicorn.conf.py \
|
||||
--bind 0.0.0.0:8000 \
|
||||
--workers "${GUNICORN_WORKERS:-3}" \
|
||||
--access-logfile - \
|
||||
|
||||
27
docker/gunicorn.conf.py
Normal file
27
docker/gunicorn.conf.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
_PROBE_PATH = re.compile(
|
||||
r"^(?:/live|/ready|/metrics|/healthz|/health[^ ]*|/ping)/?(?:\?|$)"
|
||||
)
|
||||
|
||||
|
||||
class _ProbePathFilter(logging.Filter):
|
||||
def filter(self, record: logging.LogRecord) -> bool:
|
||||
request = getattr(record, "args", None)
|
||||
if isinstance(request, dict):
|
||||
path = request.get("U") or request.get("r", "")
|
||||
else:
|
||||
path = record.getMessage()
|
||||
return not _PROBE_PATH.search(path)
|
||||
|
||||
|
||||
_filter = _ProbePathFilter()
|
||||
|
||||
|
||||
def on_starting(server):
|
||||
logging.getLogger("gunicorn.access").addFilter(_filter)
|
||||
|
||||
|
||||
def post_worker_init(worker):
|
||||
logging.getLogger("gunicorn.access").addFilter(_filter)
|
||||
Reference in New Issue
Block a user