generated from google-gemini/aistudio-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 633 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 633 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
# --- Stage 1: Build Frontend ---
FROM node:20-slim AS frontend-builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
# Build the React app (outputs to /app/dist)
RUN npm run build
# --- Stage 2: Serve with Python ---
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
# Install backend dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY . .
# Copy built frontend from Stage 1 -> /app/dist
COPY --from=frontend-builder /app/dist ./dist
# Expose port (Cloud Run default)
EXPOSE 8080
# Run FastAPI app
CMD ["python", "main.py"]