-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 831 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 831 Bytes
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
37
FROM python:3.12-slim-bookworm AS base
# Python optimizations
ENV PYTHONUNBUFFERED=1
ENV UV_COMPILE_BYTECODE=1
WORKDIR /app
FROM base AS builder
COPY --from=ghcr.io/astral-sh/uv:0.5.4 /uv /bin/
COPY ./pyproject.toml ./uv.lock ./
COPY ./bases ./bases
COPY ./components ./components
RUN --mount=type=cache,id=uv_cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
FROM base AS dev
COPY --from=ghcr.io/astral-sh/uv:0.5.4 /uv uvx/ /bin/
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app"
COPY ./projects/api_public/pyproject.toml ./projects/api_public/uv.lock ./
COPY ./bases ./bases
COPY ./components ./components
# this isntalls dev dependencies
RUN --mount=type=cache,id=uv_cache,target=/root/.cache/uv \
uv sync --frozen
CMD [ "sleep", "infinity" ]