# Use official Python 3.10 slim image for a smaller footprint FROM python:3.10-slim # Set working directory WORKDIR /app # Copy requirements file COPY requirements.txt . # Install system dependencies and Python packages RUN apt-get update && apt-get install -y \ gcc \ && rm -rf /var/lib/apt/lists/* \ && pip install --no-cache-dir -r requirements.txt # Copy application code COPY app.py . # Create cache directory for Hugging Face models RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Expose port for FastAPI EXPOSE 8000 # Run Uvicorn server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]