File size: 659 Bytes
997e297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cafbc06
997e297
 
 
 
 
2c7cc75
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use a lightweight Python image
FROM python:3.10-slim

# Set the working directory inside the cloud server
WORKDIR /app

# Install 'unzip' utility on the Linux server
RUN apt-get update && apt-get install -y unzip

# Copy the requirements file and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all your backend files (including model.zip)
COPY . .

# Unzip the model and remove the zip file to save space!
RUN unzip model.zip -d ./ && rm model.zip

# Hugging Face Spaces require port 7860
EXPOSE 7860

# The command to start your FastAPI server
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]