FROM python:3.13-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONPATH=/app \
    POETRY_VIRTUALENVS_CREATE=false \
    POETRY_NO_INTERACTION=1

RUN pip install --no-cache-dir poetry

WORKDIR /app
COPY pyproject.toml ./
RUN poetry install --no-root --only main

COPY . .

EXPOSE 8000
# Hosts such as Render set PORT; locally it is 8000. docker-compose overrides this with --reload.
CMD ["sh", "start.sh"]
