# API Dockerfile Optimized FROM python:3.12-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all project files COPY . . EXPOSE 8000 # Execute setup script THEN start the API CMD ["sh", "-c", "python setup_models.py && uvicorn main:app --host 0.0.0.0 --port 8000"]