File size: 531 Bytes
762b3c6
4b8202a
38d9b9a
629c3f3
 
762b3c6
 
 
38d9b9a
762b3c6
7d2b8e1
 
762b3c6
e396e5a
762b3c6
e396e5a
762b3c6
4b8202a
 
762b3c6
4b8202a
38d9b9a
762b3c6
b099d18
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
# Use official Python image
FROM python:3.9-slim

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    HF_HOME="/app/huggingface_cache" \
    TRANSFORMERS_CACHE="/app/huggingface_cache"

# Create cache directory
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME

# Copy app files
WORKDIR /app
COPY . .

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

# Expose FastAPI port
EXPOSE 8000

# Run FastAPI
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]