# --- Base image FROM python:3.12-slim # System deps (add build tools if you need to compile packages) RUN apt-get update && apt-get install -y --no-install-recommends \ curl && \ rm -rf /var/lib/apt/lists/* # Set workdir WORKDIR /app # Copy deps first for better Docker layer caching COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt # Copy app code COPY app /app/app # Expose port EXPOSE 8000 # Non-root (optional good practice) RUN useradd -m appuser USER appuser # Launch server CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]