-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 963 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 963 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 frontend ──────────────────────────────
FROM node:22-alpine AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package.json ./
RUN npm install
COPY frontend/ .
RUN npm run build
# ── Stage 2: Python backend ───────────────────────────────
FROM python:3.12-slim
WORKDIR /app
# System deps for git (needed for analyze-git endpoint)
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
# Python deps
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Backend code
COPY backend/ ./backend/
# Copy built frontend into location where FastAPI will serve it
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
# Expose
EXPOSE 8000
# Run
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]