Skip to content

Commit

Permalink
Merge pull request #184 from NASA-AMMOS/feature/AERIE-1862--node-dock…
Browse files Browse the repository at this point in the history
…er-non-root

[AERIE-1862] Change nvm install location to /usr/src
  • Loading branch information
patkenneally authored May 31, 2022
2 parents 9193a3a + bea7c99 commit 27bfaf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions merlin-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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"]
7 changes: 4 additions & 3 deletions scheduler-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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"]

0 comments on commit 27bfaf6

Please sign in to comment.