-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 807 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 807 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
# Stage 1: Build React frontend
FROM node:24 AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Python backend with static files
FROM python:3.13-slim-trixie
WORKDIR /app
# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.11 /uv /bin/uv
# Copy workspace configuration files for dependency resolution
COPY uv.lock pyproject.toml ./
# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --link-mode=copy
# Copy source code after dependency installation
COPY app/ ./app/
# Copy built frontend from previous stage
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
# Expose port
EXPOSE 8000
# Run FastAPI application with uv and fastapi
ENTRYPOINT ["uv", "run", "fastapi", "run"]