File size: 811 Bytes
c530055
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Stage 1: Build the Vite frontend
FROM node:18-alpine AS frontend-builder
WORKDIR /app/dashboard
COPY dashboard/package*.json ./
RUN npm ci
COPY dashboard/ ./
RUN npm run build

# Stage 2: Serve the backend with FastAPI
FROM python:3.11-slim
WORKDIR /app

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

# Copy the entire project code
COPY . /app

# Copy the compiled frontend output from the builder stage
COPY --from=frontend-builder /app/dashboard/dist /app/dashboard/dist

# Expose the port Hugging Face Spaces expects
EXPOSE 7860

# Set environment variables for production behavior
ENV NOTIFLOW_DEMO_MODE=false

# Start the uvicorn server on the HF port
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]