FROM debian:bookworm-slim

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONDONTWRITEBYTECODE=1

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
       bash \
       ca-certificates \
       coreutils \
       g++ \
       make \
       perl \
       python3 \
       python3-pip \
       texlive-bibtex-extra \
       texlive-fonts-recommended \
       texlive-latex-base \
       texlive-latex-extra \
       texlive-latex-recommended \
       texlive-science \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /work

COPY requirements.txt .
RUN python3 -m pip install --no-cache-dir --break-system-packages -r requirements.txt

COPY . .

CMD ["bash", "run_all_submission_checks.sh"]
