Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
FROM python:3.13-slim AS build-env
RUN apt-get update && apt-get -y install git
RUN pip install --upgrade pip setuptools wheel
RUN pip install pdm

COPY pyproject.toml pdm.lock README.md /app/
COPY pyproject.toml README.md /app/

WORKDIR /app

RUN mkdir __pypackages__ && pdm sync --prod --no-editable
# Extract dependencies from pyproject.toml and install with pip
# PDM has compatibility issues with Python 3.13 causing segfaults
RUN echo "koreo-core==0.1.17" > requirements.txt && \
echo "cel-python==0.3.0" >> requirements.txt && \
echo "kr8s==0.20.7" >> requirements.txt && \
echo "uvloop==0.21.0" >> requirements.txt && \
echo "starlette==0.47.2" >> requirements.txt && \
echo "uvicorn==0.35.0" >> requirements.txt

RUN pip install -r requirements.txt --target __pypackages__

COPY src/ /app/src

FROM python:3.13-slim
RUN apt-get update && apt-get -y install git

COPY --from=build-env /app/__pypackages__/3.13/lib /app/pkgs
COPY --from=build-env /app/__pypackages__/3.13/bin /app/bin/
COPY --from=build-env /app/__pypackages__ /app/pkgs
COPY --from=build-env /app/src /app/src

RUN adduser --system --no-create-home --uid 1000 nonroot
Expand Down