Skip to content

Commit 034f61c

Browse files
Merge pull request #58 from nullinside-development-group/feature/Certs
🐛 Fixing issue with installing npm
2 parents 302698c + e9097ed commit 034f61c

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

Dockerfile

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,29 @@ FROM nginx:latest
22
ARG BUILD_ENVIRONMENT
33
ARG IP_ADDRESS
44

5+
# Switch to root to do installs and such
56
USER root
6-
RUN apt-get update && apt-get install -y ca-certificates curl gnupg software-properties-common npm
7-
# RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
8-
# ENV NODE_MAJOR=18
9-
# RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
10-
# RUN apt-get update && apt-get install nodejs -y
11-
RUN npm install npm@latest -g && \
12-
npm install n -g && \
13-
n latest
7+
8+
# Use the bash shell, this is required to get a good install of nvm
9+
SHELL ["/bin/bash", "--login", "-c"]
10+
11+
# Update the software
12+
RUN apt-get update && apt-get install -y ca-certificates curl gnupg software-properties-common
13+
14+
# Setup the NVM variables
15+
ENV NVM_DIR=/usr/local/nvm
16+
ENV NODE_VERSION=22.11.0
17+
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules
18+
ENV PATH=$NVM_DIR/v$NODE_VERSION/bin:$PATH
19+
20+
# Create the install directory for NVM
21+
RUN mkdir /usr/local/nvm
22+
23+
# Download and install NVM
24+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \
25+
&& . $NVM_DIR/nvm.sh \
26+
&& nvm install $NODE_VERSION \
27+
&& nvm use $NODE_VERSION
1428

1529
# Remove the default stuff from the filesystem
1630
RUN rm -rf /usr/share/nginx/html/*

0 commit comments

Comments
 (0)