-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.dev
More file actions
49 lines (36 loc) · 1.52 KB
/
Dockerfile.dev
File metadata and controls
49 lines (36 loc) · 1.52 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
37
38
39
40
41
42
43
44
45
46
47
48
49
# Base stage: Start with Node.js (already includes npm and nodejs)
FROM node:20-slim AS base
# No additional system dependencies needed!
# node:20-slim already includes Node.js, npm, and SSL/TLS support for uv
# Install uv from official image
COPY --from=ghcr.io/astral-sh/uv:0.5.11 /uv /uvx /bin/
# UV configuration for optimal Docker builds
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PYTHON_CACHE_DIR=/root/.cache/uv/python
# Install Python 3.12 using uv (fast!)
RUN --mount=type=cache,target=/root/.cache/uv \
uv python install 3.12
# Dependencies stage: Install dependencies only (not the project itself)
FROM base AS dependencies
WORKDIR /app
# Copy only dependency files first for better caching
COPY ./pyproject.toml ./uv.lock /app/
# Install dependencies WITH dev dependencies for hot reloading
# Uses --no-install-project to skip installing the evalap package itself
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --all-groups --no-install-project
# Final stage: Application code + project installation
FROM dependencies AS final
# Copy application code
COPY ./docs /app/docs
COPY ./evalap /app/evalap
COPY ./scripts /app/scripts
COPY supervisord.conf /app/supervisord.conf
COPY supervisord.dev.conf /app/supervisord.dev.conf
# Install the project itself (fast, no dependencies to download)
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --all-groups
# Add the virtual environment to PATH so Python and packages are accessible
ENV PATH="/app/.venv/bin:$PATH"
WORKDIR /app