-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ── Build stage ───────────────────────────────────────────────────────
FROM python:3.13-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy
WORKDIR /app
# Install dependencies first (layer caching)
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
# Copy source and install the project
COPY src/ src/
COPY README.md LICENSE ./
RUN uv sync --frozen --no-dev
# ── Runtime stage ────────────────────────────────────────────────────
FROM python:3.13-slim
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/src /app/src
# Ensure data directories exist
RUN mkdir -p data/json data/db
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8501
ENTRYPOINT ["project"]
CMD ["run"]