File size: 645 Bytes
8223b74 | 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 | FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Set environment variables for better performance
ENV PYTHONUNBUFFERED=1 \
TRANSFORMERS_CACHE=/app/.cache/huggingface \
TOKENIZERS_PARALLELISM=true
# Create cache directory for model downloads
RUN mkdir -p /app/.cache/huggingface
# Copy application code
COPY . .
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--reload"] |