File size: 614 Bytes
2a14080
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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:18-alpine as frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ .
RUN npm run build

# Stage 2: Setup Backend & Serve
FROM python:3.11-slim

WORKDIR /app

# Copy Backend Requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy Backend Code
COPY . .

# Copy Frontend Build from Stage 1
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist

# Expose Port 7860 (Hugging Face Default)
EXPOSE 7860

# Run Application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]