File size: 889 Bytes
b57ae90
 
61e11a0
b57ae90
 
 
 
 
61e11a0
b57ae90
61e11a0
 
b57ae90
2f1ad38
b57ae90
 
2f1ad38
 
61e11a0
23e781a
90824a5
b860c65
61e11a0
adeecd5
2f1ad38
b57ae90
61e11a0
 
b57ae90
 
2f1ad38
 
61e11a0
b57ae90
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
# Stage 1: Build the frontend
FROM node:20-slim AS frontend-builder
WORKDIR /app/frontend

# Copy frontend dependency files
COPY frontend/package*.json ./
RUN npm install

# Copy frontend source
COPY frontend/ ./

# Run build
RUN npm run build

# Stage 2: Build the backend and serve the frontend
FROM python:3.10-slim
WORKDIR /app

# Copy the backend requirements first
COPY feature-flag-agent-env/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the backend source
COPY feature-flag-agent-env/ ./

# Copy the frontend static build to the 'static' directory in backend
# The path in stage 1 was /app/frontend/out
COPY --from=frontend-builder /app/frontend/out ./static

# Expose port 7860 (default for Hugging Face Spaces)
EXPOSE 7860

# Command to run the FastAPI app
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]