-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mojaloop/#3441): nodejs upgrade (#252)
* feat: nodejs upgrade * npm lint * fix test runner * chore(snapshot): 12.1.0-snapshot.0 * remove unneeded ci step * chore(snapshot): 12.1.0-snapshot.1 * remove unneeded ci step 2
- Loading branch information
1 parent
e5e5893
commit e033336
Showing
8 changed files
with
8,873 additions
and
6,556 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 +1 @@ | ||
16.15.0 | ||
18.17.1 |
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,31 +1,49 @@ | ||
FROM node:16.15.0-alpine as builder | ||
# Arguments | ||
ARG NODE_VERSION=lts-alpine | ||
|
||
# NOTE: Ensure you set NODE_VERSION Build Argument as follows... | ||
# | ||
# export NODE_VERSION="$(cat .nvmrc)-alpine" \ | ||
# docker build \ | ||
# --build-arg NODE_VERSION=$NODE_VERSION \ | ||
# -t mojaloop/central-event-processor:local \ | ||
# . \ | ||
# | ||
|
||
# Build Image | ||
FROM node:${NODE_VERSION} as builder | ||
USER root | ||
|
||
WORKDIR /opt/app | ||
|
||
RUN apk --no-cache add git | ||
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool libressl-dev openssl-dev autoconf automake \ | ||
&& cd $(npm root -g)/npm \ | ||
&& npm config set unsafe-perm true \ | ||
&& npm install -g node-gyp | ||
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool openssl-dev autoconf automake bash \ | ||
&& cd $(npm root -g)/npm | ||
|
||
COPY package.json package-lock.json* /opt/app/ | ||
|
||
RUN npm ci | ||
|
||
COPY package*.json /opt/app/ | ||
RUN apk del build-dependencies | ||
|
||
RUN npm ci --production | ||
COPY src /opt/app/src | ||
COPY config /opt/app/config | ||
|
||
FROM node:${NODE_VERSION} | ||
|
||
FROM node:16.15.0-alpine | ||
WORKDIR /opt/app | ||
|
||
# Create empty log file & link stdout to the application log file | ||
RUN mkdir ./logs && touch ./logs/combined.log | ||
# Links combined to stdout | ||
RUN ln -sf /dev/stdout ./logs/combined.log | ||
|
||
# Create a non-root user: ml-user | ||
RUN adduser -D ml-user | ||
USER ml-user | ||
|
||
COPY --chown=ml-user --from=builder /opt/app . | ||
# Create a non-root user:app-user | ||
RUN adduser -D app-user | ||
USER app-user | ||
|
||
COPY src /opt/app/src | ||
COPY config /opt/app/config | ||
COPY --chown=app-user --from=builder /opt/app . | ||
RUN npm prune --production | ||
|
||
EXPOSE 3080 | ||
CMD ["npm", "run", "start"] | ||
CMD ["npm", "start"] |
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
Oops, something went wrong.