FROM python:3.12.0-bullseye

WORKDIR /project

RUN apt-get update \
 && apt-get install --no-install-recommends --yes \
    curl \
    zip \
    graphviz \
    dvipng \
    imagemagick \
    make \
    latexmk \
    texlive-latex-recommended \
    texlive-latex-extra \
    texlive-xetex \
    fonts-freefont-otf \
    texlive-fonts-recommended \
    texlive-lang-greek \
    tex-gyre \
 && apt-get autoremove \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
    unzip awscliv2.zip && \
    ./aws/install && \
    rm -rf ./aws && \
    rm awscliv2.zip

RUN \
    python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir Sphinx Pillow

ADD requirements_docs.txt /project
RUN \
    python3 -m pip install -r requirements_docs.txt

CMD ["sphinx-build", "-M", "html", ".", "_build"]
