Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mojaloop/#3441): nodejs upgrade #252

Merged
merged 7 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
405 changes: 206 additions & 199 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.15.0
18.17.1
50 changes: 34 additions & 16 deletions Dockerfile
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"]
15 changes: 14 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
"GHSA-8h2f-7jc4-7m3m",
"GHSA-3vjf-82ff-p4r3",
"GHSA-gmv4-r438-p67f",
"GHSA-p9pc-299p-vxgp"
"GHSA-p9pc-299p-vxgp",
// third party dependencies
"GHSA-67hx-6x53-jw92",
"GHSA-gxpj-cx7g-858c",
"GHSA-6xrf-q977-5vgc",
"GHSA-8cf7-32gw-wr33",
"GHSA-hjrf-2m68-5959",
"GHSA-qwph-4952-7xr6",
"GHSA-7fh5-64p2-3v2j",
"GHSA-hrpp-h998-j3pp",
"GHSA-p8p7-x288-28g6",
"GHSA-c2qf-rxjj-qqgw",
"GHSA-72xf-g2v4-qvf3",
"GHSA-g694-m8vq-gv9h"
]
}
Loading