File size: 499 Bytes
bf2f6ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Python 3.10 or later
FROM python:3.10

# Set the working directory
WORKDIR /app

# Set Hugging Face cache directory
ENV HF_HOME=/huggingface
ENV TRANSFORMERS_CACHE=/huggingface/cache

# Ensure cache directory exists
RUN mkdir -p /huggingface/cache

# Copy files
COPY requirements.txt app.py ./

# Install dependencies and store cache
RUN pip install -r requirements.txt

# Expose port for FastAPI
EXPOSE 7860

# Run FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]