Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.mypy_cache
.pytest_cache
.ruff_cache
.venv
__pycache__
*.py[cod]
build
dist
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.14-slim
FROM python:3.14-slim AS builder

WORKDIR /app

Expand All @@ -9,13 +9,21 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY pyproject.toml uv.lock ./

# Install dependencies
RUN uv sync --frozen --no-install-project --no-dev
RUN uv sync --frozen --no-install-project --no-dev --compile-bytecode

# Copy source code
COPY . .

# Install the project itself
RUN uv sync --frozen --no-dev
RUN uv sync --frozen --no-dev --compile-bytecode

FROM nvcr.io/nvidia/distroless/python:3.14-v4.0.10

WORKDIR /app
ENV PATH="/app/.venv/bin:${PATH}" \
PYTHONUNBUFFERED=1

COPY --from=builder /app /app

EXPOSE 8000
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["/app/.venv/bin/uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Loading