-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to install Node.JS.
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
# The base image to build. Define the context name for the build stage. | ||
FROM eclipse-temurin:21-jdk-alpine as builder | ||
|
||
# The Node.JS build work directory. | ||
RUN apk add libstdc++ | ||
WORKDIR /opt | ||
RUN wget $NODE_PACKAGE_URL | ||
RUN mkdir -p /opt/nodejs | ||
RUN tar -zxvf *.tar.gz --directory /opt/nodejs --strip-components=1 | ||
RUN rm *.tar.gz | ||
RUN ln -s /opt/nodejs/bin/node /usr/local/bin/node | ||
RUN ln -s /opt/nodejs/bin/npm /usr/local/bin/npm | ||
RUN npm install -g [email protected] | ||
|
||
# The build work directory. | ||
WORKDIR /opt/app | ||
|
||
# The Node.js version to install. | ||
ENV NODE_PACKAGE_URL https://unofficial-builds.nodejs.org/download/release/v20.13.1/node-v20.13.1-linux-x64-musl.tar.gz | ||
|
||
# Copy the source code into the Docker image to be used for compiling. | ||
COPY .mvn/ .mvn | ||
COPY mvnw pom.xml ./ | ||
|
@@ -27,6 +41,9 @@ RUN ./mvnw clean verify -DskipTests | |
# The base image to package. This is a multi-stage build using a new context. | ||
FROM eclipse-temurin:21-jdk-jammy | ||
|
||
# Install Node.JS and NPM via NVM. | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && source ~/.bashrc && nvm install v20.13.1 && nvm use v20.13.1 | ||
|
||
# Install PostgreSQL and change PostgreSQL authentication to trust. | ||
# Install the PostgreSQL package. Remove the package lists to reduce the image size. | ||
RUN apt-get update && apt-get install -y postgresql && rm -rf /var/lib/apt/lists/* | ||
|