File size: 526 Bytes
e18f702
 
a38b4f9
 
 
 
ea8995e
 
 
 
 
 
e18f702
 
a38b4f9
e18f702
a38b4f9
 
e18f702
 
a38b4f9
e18f702
99a91e8
a38b4f9
e18f702
99a91e8
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
# Use lightweight Python
FROM python:3.10-slim

# Set working directory
WORKDIR /app


# Set env for Hugging Face cache
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
ENV HF_HUB_CACHE=/tmp/hf_cache

# Copy requirements first for caching
COPY requirements.txt .

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

# Copy project files
COPY . .

# Expose FastAPI port
EXPOSE 7860

# Run FastAPI with uvicorn
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}"]