ARG BUILD_FROM
FROM ${BUILD_FROM}

ENV LANG=C.UTF-8

RUN apt-get update \
  && apt-get install -y --no-install-recommends python3 python3-pip python3-venv \
  && rm -rf /var/lib/apt/lists/*

# Isolated venv (Debian bookworm marks the system env externally-managed)
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

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

COPY run.sh /
COPY broadcaster.py /
RUN chmod a+x /run.sh

CMD [ "/run.sh" ]
