diff --git a/Taskfile.yaml b/Taskfile.yaml index b8d69fa..81417e0 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -7,7 +7,8 @@ includes: deno: ./Taskfile.deno.yaml vars: - NBL_HOME_DIR: /var/run/noteable + NBL_HOME_DIR: /srv/noteable + NBL_WORK_DIR: /var/run/noteable tasks: copy-root-files: @@ -42,6 +43,7 @@ tasks: vars: [LANGUAGE, IDENTIFIER, NBL_LANGUAGE_VERSION] vars: BUILD_TARGET: '{{default "base" .BUILD_TARGET}}' - NBL_HOME_DIR: '{{default "/var/run/noteable" .NBL_HOME_DIR}}' + NBL_HOME_DIR: '{{default "/srv/noteable" .NBL_HOME_DIR}}' + NBL_WORK_DIR: '{{default "/var/run/noteable" .NBL_WORK_DIR}}' TAG_SUFFIX: '{{default "" .TAG_SUFFIX}}' TAG: '{{default "dev" .TAG}}' diff --git a/deno/base/1.37/Dockerfile b/deno/base/1.37/Dockerfile index 5eea416..c3d686f 100644 --- a/deno/base/1.37/Dockerfile +++ b/deno/base/1.37/Dockerfile @@ -8,7 +8,9 @@ # Rust 1.72 is required FROM rust:1.72 as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable # User/group setup USER root @@ -24,11 +26,12 @@ RUN groupadd --gid 4004 noteable && \ --no-log-init \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ - chown --recursive noteable:noteable "${NBL_HOME_DIR}" + chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" -# TEMPORARY: symlink the previous /etc/noteable to the new NBL_HOME_DIR (/var/run/noteable) dir +# TEMPORARY: symlink the previous /etc/noteable to the new NBL_WORK_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable WORKDIR /tmp @@ -58,7 +61,7 @@ COPY run.sh /usr/local/bin ENV HOME="${NBL_HOME_DIR}" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 ENTRYPOINT ["tini", "-g", "--"] diff --git a/python/base-gpu/3.10/Dockerfile b/python/base-gpu/3.10/Dockerfile index b85a38a..4a8362f 100644 --- a/python/base-gpu/3.10/Dockerfile +++ b/python/base-gpu/3.10/Dockerfile @@ -2,7 +2,9 @@ # hadolint ignore=DL3006 FROM base AS main -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION=3.10 USER root @@ -81,4 +83,4 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_DIR/lib/:$CUDNN_PATH/lib \ # Overwrite the base run.sh to include `mamba` usage COPY run.sh /usr/local/bin -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project diff --git a/python/base-gpu/3.11/Dockerfile b/python/base-gpu/3.11/Dockerfile index afc2087..a14a09e 100644 --- a/python/base-gpu/3.11/Dockerfile +++ b/python/base-gpu/3.11/Dockerfile @@ -2,7 +2,9 @@ # hadolint ignore=DL3006 FROM base AS main -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION=3.11 USER root @@ -81,4 +83,4 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_DIR/lib/:$CUDNN_PATH/lib \ # Overwrite the base run.sh to include `mamba` usage COPY run.sh /usr/local/bin -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project diff --git a/python/base-gpu/3.9/Dockerfile b/python/base-gpu/3.9/Dockerfile index c70b7ff..99cbe40 100644 --- a/python/base-gpu/3.9/Dockerfile +++ b/python/base-gpu/3.9/Dockerfile @@ -2,7 +2,9 @@ # hadolint ignore=DL3006 FROM base AS main -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION=3.9 USER root @@ -81,4 +83,4 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_DIR/lib/:$CUDNN_PATH/lib \ # Overwrite the base run.sh to include `mamba` usage COPY run.sh /usr/local/bin -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project diff --git a/python/base/3.10/Dockerfile b/python/base/3.10/Dockerfile index 8ecff1b..afbbfcf 100644 --- a/python/base/3.10/Dockerfile +++ b/python/base/3.10/Dockerfile @@ -7,7 +7,9 @@ ARG NBL_PYTHON_VERSION=3.10 FROM python:${NBL_PYTHON_VERSION}-slim-bullseye as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION # User/group setup @@ -25,12 +27,13 @@ RUN groupadd --gid 4004 noteable && \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" && \ mkdir /opt/venv && chown noteable:noteable /opt/venv && \ mkdir /etc/ipython && chown noteable:noteable /etc/ipython # TEMPORARY: symlink the previous /etc/noteable to the new NBL_HOME_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable WORKDIR /tmp @@ -60,7 +63,7 @@ ENV HOME="${NBL_HOME_DIR}" \ XDG_CACHE_HOME="${NBL_HOME_DIR}/.cache/" \ GOOGLE_APPLICATION_CREDENTIALS="/vault/secrets/gcp-credentials" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 ENTRYPOINT ["/tini", "-g", "--"] diff --git a/python/base/3.11/Dockerfile b/python/base/3.11/Dockerfile index f6b221b..01e7a71 100644 --- a/python/base/3.11/Dockerfile +++ b/python/base/3.11/Dockerfile @@ -7,7 +7,9 @@ ARG NBL_PYTHON_VERSION=3.11 FROM python:${NBL_PYTHON_VERSION}-slim-bullseye as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION # User/group setup @@ -25,12 +27,13 @@ RUN groupadd --gid 4004 noteable && \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" && \ mkdir /opt/venv && chown noteable:noteable /opt/venv && \ mkdir /etc/ipython && chown noteable:noteable /etc/ipython -# TEMPORARY: symlink the previous /etc/noteable to the new NBL_HOME_DIR (/var/run/noteable) dir +# TEMPORARY: symlink the previous /etc/noteable to the new NBL_WORK_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable WORKDIR /tmp @@ -60,7 +63,7 @@ ENV HOME="${NBL_HOME_DIR}" \ XDG_CACHE_HOME="${NBL_HOME_DIR}/.cache/" \ GOOGLE_APPLICATION_CREDENTIALS="/vault/secrets/gcp-credentials" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 ENTRYPOINT ["/tini", "-g", "--"] diff --git a/python/base/3.9/Dockerfile b/python/base/3.9/Dockerfile index 9e559ec..7dd28bf 100644 --- a/python/base/3.9/Dockerfile +++ b/python/base/3.9/Dockerfile @@ -7,7 +7,9 @@ ARG NBL_PYTHON_VERSION=3.9 FROM python:${NBL_PYTHON_VERSION}-slim-bullseye as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable ARG NBL_PYTHON_VERSION # User/group setup @@ -25,12 +27,13 @@ RUN groupadd --gid 4004 noteable && \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" && \ mkdir /opt/venv && chown noteable:noteable /opt/venv && \ mkdir /etc/ipython && chown noteable:noteable /etc/ipython -# TEMPORARY: symlink the previous /etc/noteable to the new ""${NBL_HOME_DIR}"" dir +# TEMPORARY: symlink the previous /etc/noteable to the new NBL_WORK_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable WORKDIR /tmp @@ -60,7 +63,7 @@ ENV HOME="${NBL_HOME_DIR}" \ XDG_CACHE_HOME="${NBL_HOME_DIR}/.cache/" \ GOOGLE_APPLICATION_CREDENTIALS="/vault/secrets/gcp-credentials" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 ENTRYPOINT ["/tini", "-g", "--"] diff --git a/r/base/4.3.0/Dockerfile b/r/base/4.3.0/Dockerfile index 37cb10a..50cc7e5 100644 --- a/r/base/4.3.0/Dockerfile +++ b/r/base/4.3.0/Dockerfile @@ -7,7 +7,9 @@ ARG NBL_R_VERSION=4.3.0 FROM r-base:${NBL_R_VERSION} as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable # User/group setup USER root @@ -24,11 +26,12 @@ RUN groupadd --gid 4004 noteable && \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" && \ chown --recursive noteable:noteable /usr/local/lib/R/site-library -# TEMPORARY: symlink the previous /etc/noteable to the new NBL_HOME_DIR (/var/run/noteable) dir +# TEMPORARY: symlink the previous /etc/noteable to the new NBL_WORK_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable # Install tini to manage passing signals to the child kernel process ENV TINI_VERSION v0.19.0 @@ -53,7 +56,7 @@ ENV HOME="${NBL_HOME_DIR}" \ XDG_CACHE_HOME="${NBL_HOME_DIR}/.cache/" \ GOOGLE_APPLICATION_CREDENTIALS="/vault/secrets/gcp-credentials" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 ENTRYPOINT ["/tini", "-g", "--"] diff --git a/r/noteable/4.3.0/Dockerfile b/r/noteable/4.3.0/Dockerfile index ec9d2aa..1f358b2 100644 --- a/r/noteable/4.3.0/Dockerfile +++ b/r/noteable/4.3.0/Dockerfile @@ -4,7 +4,7 @@ # hadolint ignore=DL3006 FROM base as main -ARG NBL_HOME_DIR=/var/run/noteable +ARG NBL_WORK_DIR=/var/run/noteable USER root @@ -20,4 +20,4 @@ COPY requirements.R /tmp/requirements.R RUN R -e "source('/tmp/requirements.R')" # similarly, copy any R commands that need to run on startup -COPY .Rprofile ${NBL_HOME_DIR}/.Rprofile +COPY .Rprofile ${NBL_WORK_DIR}/.Rprofile diff --git a/rust/base/1.70/Dockerfile b/rust/base/1.70/Dockerfile index bb2df23..1c98e90 100644 --- a/rust/base/1.70/Dockerfile +++ b/rust/base/1.70/Dockerfile @@ -7,7 +7,9 @@ ARG NBL_RUST_VERSION="1.70" FROM rust:${NBL_RUST_VERSION}-slim-bullseye as base -ARG NBL_HOME_DIR=/var/run/noteable +# Application code lives in NBL_HOME_DIR, project data lives in NBL_WORK_DIR +ARG NBL_HOME_DIR=/srv/noteable +ARG NBL_WORK_DIR=/var/run/noteable # User/group setup USER root @@ -23,11 +25,12 @@ RUN groupadd --gid 4004 noteable && \ --no-log-init \ --gid noteable noteable \ --home-dir "${NBL_HOME_DIR}" && \ - chown --recursive noteable:noteable "${NBL_HOME_DIR}" + chown --recursive noteable:noteable "${NBL_HOME_DIR}" && \ + mkdir -p "${NBL_WORK_DIR}" && chown noteable:noteable "${NBL_WORK_DIR}" -# TEMPORARY: symlink the previous /etc/noteable to the new NBL_HOME_DIR (/var/run/noteable) dir +# TEMPORARY: symlink the previous /etc/noteable to the new NBL_WORK_DIR (/var/run/noteable) dir # until all other services are migrated and the old /etc/noteable can be removed -RUN ln -s "${NBL_HOME_DIR}" /etc/noteable +RUN ln -s "${NBL_WORK_DIR}" /etc/noteable WORKDIR /tmp @@ -47,7 +50,7 @@ COPY run.sh /usr/local/bin ENV HOME="${NBL_HOME_DIR}" -WORKDIR ${NBL_HOME_DIR}/project +WORKDIR ${NBL_WORK_DIR}/project EXPOSE 50001-50005 RUN cargo init