File size: 783 Bytes
5c566a4
ace186a
 
5c566a4
 
a01d726
5c566a4
 
 
31382ae
 
59d49f8
5c566a4
ace186a
1f2d820
47f27f6
 
 
 
 
 
ace186a
59d49f8
47f27f6
5c566a4
ace186a
47f27f6
5c566a4
 
 
1f2d820
ace186a
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
# --- Frontend Stage (React + Vite) ---
FROM node:20-alpine AS frontend
WORKDIR /ui

# Copy package files and install deps
COPY frontend/package*.json ./
RUN npm ci --silent || npm install --silent

# Copy frontend source and build
COPY frontend ./
RUN npm run build

# --- Backend Stage (FastAPI + Python) ---
FROM python:3.11-slim
WORKDIR /app

# Install Python dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy backend code
COPY backend ./backend
COPY app.py Procfile .env.example ./

# Copy built frontend from frontend stage
COPY --from=frontend /ui/dist ./frontend_dist

# Bust cache so Hugging Face doesn’t reuse stale Node layers
ARG CACHE_BUST=1

EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]