Add PYTHONPATH=/app so Hypercorn spawn workers find app module
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m30s

Hypercorn spawns worker processes via multiprocessing spawn, which
starts a fresh Python interpreter without the parent's sys.path
modifications from path_setup.py. Setting PYTHONPATH=/app ensures
the worker can import app.py and all project packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-11 14:01:18 +00:00
parent 9e6f138f45
commit 9b180b364b

View File

@@ -13,6 +13,7 @@ FROM python:3.11-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app \
PIP_NO_CACHE_DIR=1 \
APP_PORT=8000 \
APP_MODULE=app:app