diff --git a/docker/Dockerfile b/docker/Dockerfile index aca8a4731..737e65ded 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,13 +2,25 @@ FROM ghcr.io/astral-sh/uv:0.2.18 as uv FROM base-image +USER ${NB_USER} + +ENV QE_VERSION ${QE_VERSION} +RUN mamba create -p /opt/conda/envs/quantum-espresso --yes \ + qe=${QE_VERSION} \ + && mamba clean --all -f -y && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}" + +# Download the QE pseudopotentials to the folder for afterware installation. +ENV PSEUDO_FOLDER ${CONDA_DIR}/pseudo +RUN mkdir -p ${PSEUDO_FOLDER} && \ + python -m aiidalab_qe download-pseudos --dest ${PSEUDO_FOLDER} + # Copy whole repo and pre-install the dependencies and app to the tmp folder. # In the before notebook scripts the app will be re-installed by moving it to the app folder. ENV PREINSTALL_APP_FOLDER ${CONDA_DIR}/aiidalab-qe COPY --chown=${NB_UID}:${NB_GID} --from=src . ${PREINSTALL_APP_FOLDER} -USER ${NB_USER} - # Using uv to speed up installation, per docs: # https://github.com/astral-sh/uv/blob/main/docs/guides/docker.md#using-uv-temporarily # Use the same constraint file as PIP @@ -35,19 +47,6 @@ RUN --mount=from=uv,source=/uv,target=/bin/uv \ ARG APP_VERSION ENV APP_VERSION ${APP_VERSION} -ARG QE_VERSION -ENV QE_VERSION ${QE_VERSION} -RUN mamba create -p /opt/conda/envs/quantum-espresso --yes \ - qe=${QE_VERSION} \ - && mamba clean --all -f -y && \ - fix-permissions "${CONDA_DIR}" && \ - fix-permissions "/home/${NB_USER}" - -# Download the QE pseudopotentials to the folder for afterware installation. -ENV PSEUDO_FOLDER ${CONDA_DIR}/pseudo -RUN mkdir -p ${PSEUDO_FOLDER} && \ - python -m aiidalab_qe download-pseudos --dest ${PSEUDO_FOLDER} - COPY before-notebook.d/* /usr/local/bin/before-notebook.d/ WORKDIR "/home/${NB_USER}"