FROM python:3.12-slim

RUN groupadd --gid 10001 app && \
    useradd --uid 10001 --gid app --create-home --no-log-init app

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=10001:10001 . .

ENV HOME=/home/app \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1
USER 10001:10001

CMD ["python", "bot.py"]
