# Use official Python runtime as base image FROM python:3.11-slim # Set working directory in container WORKDIR /app # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY src/ ./src/ # Create non-root user for security RUN useradd -m -u 1000 appuser && \ chown -R appuser:appuser /app USER appuser # Run the application CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]