FROM mambaorg/micromamba:1.5.8 SHELL ["/bin/bash", "-lc"] USER root RUN mkdir -p /var/lib/apt/lists/partial && \ apt-get update && \ apt-get install -y --no-install-recommends git cmake make g++ && \ rm -rf /var/lib/apt/lists/* WORKDIR /work # 1) Create env first (better cache) COPY binder/environment.yml /tmp/environment.yml RUN micromamba env create -f /tmp/environment.yml && micromamba clean -a -y # 2) Copy the WHOLE Space repo into the image # This is what makes notebooks/scripts appear in JupyterLab COPY . /work # 3) Install Jupyter config + start script RUN mkdir -p /etc/jupyter && \ cp /work/jupyter_server_config.py /etc/jupyter/jupyter_server_config.py && \ chmod +x /work/start.sh # 4) (Optional) Build StochasticCIL (keep if you need it in the Space) RUN git clone https://github.com/epapoutsellis/StochasticCIL.git && \ cd StochasticCIL && \ git fetch --all --tags && \ git checkout svrg && \ git config user.email "hf@local" && \ git config user.name "HF Build" && \ (git tag -a v1.0 -m "Version 1.0" || true) && \ mkdir -p build && cd build && \ PREFIX="$(micromamba run -n ssp python -c 'import sys, os; print(os.path.dirname(os.path.dirname(sys.executable)))')" && \ cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DCONDA_BUILD=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DLIBRARY_LIB="${PREFIX}/lib" \ -DLIBRARY_INC="${PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DPython_EXECUTABLE="${PREFIX}/bin/python" && \ make -j"$(nproc)" && \ make install EXPOSE 7860 CMD ["/work/start.sh"]