From 3f5b0d1591af6c2a14712c0390eccb84e38f1114 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Sat, 28 Feb 2026 21:42:39 +0100 Subject: [PATCH] fix: set PYTHONPATH=/app so alembic can import app package When the alembic console-script entry point runs, Python sets sys.path[0] to the entry point directory (/usr/local/bin/), not the WORKDIR. Without PYTHONPATH=/app, `from app.models import Base` in alembic/env.py fails with ModuleNotFoundError. uvicorn is unaffected as it adds CWD to sys.path itself. Co-Authored-By: Claude Sonnet 4.6 --- backend/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index f47b64f..2ed790b 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.12-slim WORKDIR /app +ENV PYTHONPATH=/app RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libpq-dev \