Skip to content

Commit

Permalink
Install node.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Dec 5, 2024
1 parent fc54305 commit 7675ef9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ENV USERNAME=""
ENV PORT=""
ENV PASSWORD=""
ENV HOME=""
ENV NVM_DIR="/usr/local/nvm"
ENV NODE_VERSION="lts/*"

WORKDIR /workspace

Expand All @@ -20,13 +22,12 @@ RUN apt-get update && \
net-tools \
nano \
zsh \
openssl \
&& rm -rf /var/lib/apt/lists/*
openssl && \
rm -rf /var/lib/apt/lists/*

# Install nvm and Node.js LTS version
ENV NVM_DIR="/usr/local/nvm"
ENV NODE_VERSION="lts/*"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && \
RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION && \
Expand All @@ -35,8 +36,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | b
ln -s $NVM_DIR/versions/node/$(nvm version default)/bin/npm /usr/local/bin/npm && \
ln -s $NVM_DIR/versions/node/$(nvm version default)/bin/npx /usr/local/bin/npx

# Ensure nvm is available for future commands
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Export PATH to ensure nvm and Node.js tools are available
ENV PATH=$NVM_DIR/versions/node/$(nvm alias default | grep -o 'v[0-9\.]*')/bin:$PATH

# Create user and setup directories for VS Code Server
COPY entrypoint.sh /entrypoint.sh
Expand Down

0 comments on commit 7675ef9

Please sign in to comment.