FROM python:3.14

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

ENV PYTHONUNBUFFERED=1

WORKDIR /usr/src/app

RUN apt-get update && \
    apt-get install -y --no-install-recommends curl ffmpeg quickjs && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./
RUN uv pip install --system --no-cache -r requirements.txt

COPY main.py parker.gif ./

RUN mkdir -p /usr/src/app/.cache && \
    chown -R 1000:1000 /usr/src/app/.cache

USER 1000:1000

CMD ["python", "./main.py"]
