Add PYTHONPATH=/app so Hypercorn spawn workers find app module
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m30s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user