File size: 581 Bytes
da90d9b
75d5dd0
da90d9b
 
73c5dad
da90d9b
 
 
 
 
 
 
c3f7bce
da90d9b
 
c3f7bce
da90d9b
 
 
 
c3f7bce
da90d9b
c3f7bce
da90d9b
 
c3f7bce
da90d9b
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
# Stage 1: Build React
FROM node:22 AS build-step
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install --legacy-peer-deps
COPY frontend/ ./
RUN npm run build

# Stage 2: Python Backend
FROM python:3.11-slim
WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the project files
COPY . .

COPY --from=build-step /app/frontend/dist /app/frontend/dist

# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

EXPOSE 7860

CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]