File size: 491 Bytes
3580467
 
9af1d50
3580467
 
9af1d50
3580467
9af1d50
3580467
 
9af1d50
 
 
 
3580467
 
9af1d50
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.9

# Set working directory
WORKDIR /app

# Copy requirements and install dependencies
COPY requirements.txt .
RUN python -m pip install --upgrade pip
RUN pip install -r requirements.txt

# Create a writable cache directory for Hugging Face models
RUN mkdir -p /app/hf_home/ && chmod -R 777 /app/hf_home/

# Copy application files
COPY app.py .

# Set HF_HOME and run the application
CMD ["sh", "-c", "export HF_HOME=/app/hf_home && uvicorn app:app --host 0.0.0.0 --port 7860"]