File size: 585 Bytes
dcbee48
fcd4851
 
 
 
 
dcbee48
fcd4851
dcbee48
 
fcd4851
 
dcbee48
63bfc76
 
 
 
dcbee48
fcd4851
 
 
dcbee48
fcd4851
 
dcbee48
fcd4851
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Base image
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Copy requirements
COPY requirements.txt .

# Install dependencies
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Create writable cache directory for Hugging Face

ENV HF_HOME="/tmp/huggingface"
ENV HF_DATASETS_CACHE="/tmp/huggingface"
ENV TRANSFORMERS_CACHE="/tmp/huggingface"

# Copy app.py
COPY . .

# Expose default HF Space port
EXPOSE 7860

# Use python -m uvicorn to avoid PATH issues
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]