FROM ghcr.io/gammasim/simtools-corsika_sim_telarray
WORKDIR /workdir
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_BRANCH=main

RUN microdnf update -y && microdnf install -y \
    git \
    python3.11-pip \
    python3.11-devel && \
    microdnf clean all

RUN git clone -b $BUILD_BRANCH https://github.com/gammasim/simtools.git --depth 1
RUN cd /workdir/ && \
    python3.11 -m venv env && \
    source env/bin/activate && \
    cd /workdir/simtools/ && \
    pip install --no-cache-dir .

ENV SIMTEL_PATH="/workdir/sim_telarray/"
ENV PATH="/workdir/env/bin/:$PATH"
SHELL ["/bin/bash", "-c"]

WORKDIR /workdir
