# IMPORTANT: Use .. for the Build Context https://docs.docker.com/build/building/context/
# i.e. `sudo docker build ... -f Dockerfile ..`
FROM amazonlinux

# Install conda / mamba
RUN yum update -y && yum install -y wget

ARG CONDA="Miniforge3-Linux-x86_64.sh"

RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
    chmod +x $CONDA && \
    ./$CONDA -b -p /miniforge && \
    rm -f $CONDA
ENV PATH /miniforge/bin:$PATH

# Install Sophios
RUN yum install -y git

COPY . /sophios
WORKDIR /sophios

RUN mamba env update --name base --file install/system_deps.yml
RUN pip install -e ".[all_except_runner_src]"

RUN mamba clean --all --yes
RUN pip cache purge
RUN yum clean all

ADD docker/Dockerfile_amazon .
