File size: 554 Bytes
d3e9141
 
 
c8d9e89
 
 
 
 
d3e9141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use a slim Python image
FROM python:3.10-slim

ENV HF_HOME=/home/user/.cache/huggingface
RUN mkdir -p /home/user/.cache/huggingface && \
    chmod 777 /home/user/.cache/huggingface


# Install system deps
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy & install Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy your API code
COPY app.py .

# Expose port and launch with uvicorn
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]