Skip to content

Commit

Permalink
feat(mojaloop/#3441): nodejs upgrade (#252)
Browse files Browse the repository at this point in the history
* 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
aaronreynoza authored Dec 20, 2023
1 parent e5e5893 commit e033336
Show file tree
Hide file tree
Showing 8 changed files with 8,873 additions and 6,556 deletions.
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

0 comments on commit e033336

Please sign in to comment.