File size: 674 Bytes
1e6288e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# This is the single Dockerfile for our entire backend on Hugging Face Spaces
FROM python:3.11-slim

# Set a single working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y git redis-server

# Copy all requirements and model files first for better caching
COPY backend/requirements.txt .
COPY ml_models ./ml_models

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

# Copy the entire backend source code
COPY backend .

# Create a startup script
COPY startup.sh .
RUN chmod +x startup.sh

# Expose the port FastAPI will run on
EXPOSE 7860

# The command to run our startup script
CMD ["./startup.sh"]