FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /app

COPY pyproject.toml README.md /app/
COPY catan /app/catan
COPY services /app/services

RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir -e . \
    && pip install --no-cache-dir -r services/analytics/requirements.txt

ENV PYTHONPATH=/app
EXPOSE 8003

CMD ["uvicorn", "services.analytics.app:app", "--host", "0.0.0.0", "--port", "8003"]
