Skip to content

Commit 7d9ebe3

Browse files
authored
fix: add /app to container pythonpath (#3972)
Signed-off-by: lucarlig <luca.carlig@ibm.com>
1 parent 298b32d commit 7d9ebe3

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

Containerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ EXPOSE 4444
117117
# Set the runtime user
118118
USER 1001
119119

120-
# Ensure virtual environment binaries are in PATH
121-
ENV PATH="/app/.venv/bin:$PATH"
120+
# Ensure virtual environment binaries are in PATH and project modules resolve
121+
# even when containers run an alternate Python entrypoint.
122+
ENV PATH="/app/.venv/bin:$PATH" \
123+
PYTHONPATH="/app"
122124

123125
# HTTP server selection via HTTP_SERVER environment variable:
124126
# - gunicorn : Python-based with Uvicorn workers (default)

Containerfile.lite

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ COPY --from=builder --chown=1001:0 /app /app
318318
# - Disable pip version check to reduce startup time
319319
# ----------------------------------------------------------------------------
320320
ENV PATH="/app/.venv/bin:${PATH}" \
321+
PYTHONPATH="/app" \
321322
CONTEXTFORGE_ENABLE_RUST_BUILD=${ENABLE_RUST} \
322323
CONTEXTFORGE_ENABLE_RUST_MCP_RMCP_BUILD=${ENABLE_RUST_MCP_RMCP} \
323324
PYTHONDONTWRITEBYTECODE=1 \

Containerfile.scratch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ COPY --from=builder ${ROOTFS_PATH}/ /
321321
# - Disable pip version check to reduce startup time
322322
# ----------------------------------------------------------------------------
323323
ENV PATH="/app/.venv/bin:${PATH}" \
324+
PYTHONPATH="/app" \
324325
PYTHONDONTWRITEBYTECODE=1 \
325326
PYTHONUNBUFFERED=1 \
326327
PYTHONHASHSEED=random \

0 commit comments

Comments
 (0)