@@ -2,15 +2,29 @@ FROM nginx:latest
2
2
ARG BUILD_ENVIRONMENT
3
3
ARG IP_ADDRESS
4
4
5
+ # Switch to root to do installs and such
5
6
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
14
28
15
29
# Remove the default stuff from the filesystem
16
30
RUN rm -rf /usr/share/nginx/html/*
0 commit comments