File size: 573 Bytes
006ed0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.12

# Set the working directory
WORKDIR /app

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

# Install git-lfs (required for Hugging Face models if used)
RUN apt-get update && apt-get install -y git-lfs

# Copy application files
COPY . .

# Set Hugging Face cache directory
ENV HF_HOME="/app/huggingface"

# Expose the port required by Hugging Face
EXPOSE 7860

# Run FastAPI with Uvicorn (on port 7860 to match Hugging Face expectations)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]