FROM python:3.13-slim AS base

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy source
COPY src/ src/
COPY api/ api/

# Expose port
EXPOSE 8000

# Health check (Railway manages its own health checks via /health endpoint)
HEALTHCHECK NONE

# Run with uvicorn — shell form so $PORT expands (Railway injects PORT env var)
CMD uvicorn api.main:app --host 0.0.0.0 --port ${PORT:-8000} --workers 2
