-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 865 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 865 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
# --- Frontend build (vite) ---
FROM node:20-alpine AS frontend
WORKDIR /app/Frontend
# Install dependencies and build the frontend
COPY Frontend/ava-03/package*.json ./
RUN npm ci
# Copy source and build
COPY Frontend/ava-03/ ./
# outputs /app/frontend/dist
RUN NODE_OPTIONS=--max_old_space_size=2048 npm run build
# ---------- Backend stage ----------
FROM python:3.11-slim
WORKDIR /app
# System deps
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Python deps
COPY Backend/requirements.txt ./Backend/
RUN pip install --no-cache-dir -r Backend/requirements.txt
# Backend code
COPY Backend/ ./Backend/
# Copy built frontend from the frontend stage
COPY --from=frontend /app/Frontend/dist ./FrontendDist
EXPOSE 8000
CMD ["uvicorn", "Backend.main:app", "--host", "0.0.0.0", "--port", "8000"]