FROM python:3.12-alpine

WORKDIR /app

# Runtime deps only
RUN apk add --no-cache tini

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

COPY app/ ./

# Non-root
RUN adduser -D -u 1000 animator
USER animator

ENV PYTHONUNBUFFERED=1 \
    LOG_LEVEL=INFO

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["python", "main.py"]
