File size: 919 Bytes
e73e5ff
 
 
 
 
 
 
 
 
 
 
 
 
 
bb131e8
e73e5ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
# Stage 1: Build the React Frontend
FROM node:18 AS build-frontend
WORKDIR /app/frontend
COPY toothmap_frontend/package*.json ./
RUN npm install
COPY toothmap_frontend/ ./
RUN npm run build

# Stage 2: Setup the Python Backend
FROM python:3.12-slim
WORKDIR /app

# Install system dependencies required by OpenCV
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

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

# Copy models
COPY checkpoints/ /app/checkpoints/

# Copy backend code
COPY toothmap_backend/ /app/

# Copy built React frontend to static folder
COPY --from=build-frontend /app/frontend/dist /app/static

# Expose Hugging Face default port
EXPOSE 7860

# Run FastAPI serving both the backend APIs and frontend static files
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]