From bea7c990006c40a11938552ec67c90c081dfa591 Mon Sep 17 00:00:00 2001 From: Matt Dailis Date: Wed, 25 May 2022 19:14:05 -0700 Subject: [PATCH] Change nvm install location to /usr/src --- merlin-server/Dockerfile | 7 ++++--- scheduler-server/Dockerfile | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/merlin-server/Dockerfile b/merlin-server/Dockerfile index 6cdf1fd2ba..a26d6d41ff 100644 --- a/merlin-server/Dockerfile +++ b/merlin-server/Dockerfile @@ -7,9 +7,10 @@ RUN cd /usr/src/app && tar --strip-components 1 -xf server.tar -C extracted FROM eclipse-temurin:18-focal ENV NODE_VERSION=16.14.0 -ENV NVM_DIR=/root/.nvm -ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" +ENV NVM_DIR=/usr/src/.nvm +ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:${PATH}" RUN apt install --no-install-recommends -y curl \ + && mkdir -p $NVM_DIR \ && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \ &&. "$NVM_DIR/nvm.sh" \ && nvm install -b ${NODE_VERSION} \ @@ -23,7 +24,7 @@ COPY --from=extractor /usr/src/app/extracted /usr/src/app COPY constraints-dsl-compiler /usr/src/app/constraints-dsl-compiler ENV CONSTRAINTS_DSL_COMPILER_ROOT="/usr/src/app/constraints-dsl-compiler/" ENV CONSTRAINTS_DSL_COMPILER_COMMAND="./build/main.js" -ENV NODE_PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/node" +ENV NODE_PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/node" WORKDIR /usr/src/app ENTRYPOINT ["/usr/src/app/bin/merlin-server"] diff --git a/scheduler-server/Dockerfile b/scheduler-server/Dockerfile index 72e7d13576..67f3ca5215 100644 --- a/scheduler-server/Dockerfile +++ b/scheduler-server/Dockerfile @@ -7,9 +7,10 @@ RUN cd /usr/src/app && tar --strip-components 1 -xf server.tar -C extracted FROM eclipse-temurin:18-focal ENV NODE_VERSION=16.14.0 -ENV NVM_DIR=/root/.nvm -ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" +ENV NVM_DIR=/usr/src/.nvm +ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:${PATH}" RUN apt install --no-install-recommends -y curl \ + && mkdir -p $NVM_DIR \ && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \ &&. "$NVM_DIR/nvm.sh" \ && nvm install -b ${NODE_VERSION} \ @@ -23,7 +24,7 @@ COPY --from=extractor /usr/src/app/extracted /usr/src/app COPY scheduling-dsl-compiler /usr/src/app/scheduling-dsl-compiler ENV SCHEDULING_DSL_COMPILER_ROOT="/usr/src/app/scheduling-dsl-compiler/" ENV SCHEDULING_DSL_COMPILER_COMMAND="./build/main.js" -ENV NODE_PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/node" +ENV NODE_PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/node" WORKDIR /usr/src/app ENTRYPOINT ["/usr/src/app/bin/scheduler-server"]