generated from mojaloop/typescript-svc-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(mojaloop/#3522): upgrade nodejs version (#167)
* chore: upgrade nodejs version * update dependencies and tests libraries * update tests to newer library implementation * upgrade nodejs version .nvmrc * change jest mocked function implementation * update packages, ts config, fix tests * update tests * reduce failing tests to 3 * upgraded all unit tests to jest v29 * lint * fix integration and definition tests * fix dependencies * fix junit * readd test bdd * change wait4docker method * update tests config for ci * update test-bdd dependency install method * restore wait4 * npm dep update * update wait4 npm command * change wait4docker method * change integration tests curl port * remove curl * update readme * update dependencies * log docker version on integration tests * update dependencies * update docker in default-machine configs * move docker upgrade at the setup start * update docker upgrade method * change docker upgrade method * revert * add caching to docker-compose * change image name * add image to docker-compose * remove curl to healthcheck * change redis host * change docker integration config redis endpoint * update dependencies * update readme docs for redis * update more ports * doc updates * it was the wait4 script hehe * change integration tests command * correct hosts * add wait4containers script * parsing * setup compose healthcheck * setup redis host * remove unnecesary dependencies * fix husky * remove unused dependencies
- Loading branch information
1 parent
79660f5
commit a1b0523
Showing
58 changed files
with
22,503 additions
and
35,030 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx commitlint --edit $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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
git update-index --again |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run lint && npm run test |
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
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,33 +1,45 @@ | ||
FROM node:16.15.0-alpine as builder | ||
USER root | ||
|
||
# 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/sdk-scheme-adapter:local \ | ||
# . \ | ||
# | ||
|
||
# Build Image | ||
FROM node:${NODE_VERSION} as builder | ||
WORKDIR /opt/app | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache -t build-dependencies git make gcc g++ python3 libtool autoconf automake openssh \ | ||
&& cd $(npm root -g)/npm \ | ||
&& npm config set unsafe-perm true \ | ||
&& npm install -g node-gyp | ||
RUN apk --no-cache add git | ||
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 ./ /opt/app/ | ||
RUN npm run build | ||
RUN rm -rf src secrets test docs | ||
RUN npm prune --production | ||
|
||
|
||
FROM node:16.15.0-alpine | ||
WORKDIR /opt/app/ | ||
FROM node:${NODE_VERSION} | ||
WORKDIR /opt/app | ||
|
||
# Create empty log file & link stdout to the application log file | ||
RUN mkdir ./logs && touch ./logs/combined.log | ||
RUN ln -sf /dev/stdout ./logs/combined.log | ||
|
||
# Create a non-root user: app-user | ||
RUN adduser -D app-user | ||
USER app-user | ||
COPY --chown=app-user --from=builder /opt/app/ ./ | ||
# Create a non-root user: ml-user | ||
RUN adduser -D ml-user | ||
USER ml-user | ||
|
||
COPY --chown=ml-user --from=builder /opt/app . | ||
RUN npm prune --production | ||
|
||
EXPOSE 4005 4006 | ||
CMD ["npm", "run", "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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json", | ||
// audit-ci supports reading JSON, JSONC, and JSON5 config files. | ||
// Only use one of ["low": true, "moderate": true, "high": true, "critical": true] | ||
"moderate": true, | ||
"allowlist": [ // NOTE: Please add as much information as possible to any items added to the allowList | ||
// Currently no fixes available for the following | ||
"GHSA-v88g-cgmw-v5xw", | ||
"GHSA-phwq-j96m-2c2q", | ||
"GHSA-282f-qqgm-c34q", | ||
"GHSA-6vfc-qv3f-vr6c", | ||
"GHSA-wc69-rhjr-hc9g", | ||
"GHSA-g954-5hwp-pp24", | ||
"GHSA-h755-8qp9-cq85", | ||
"GHSA-mjxr-4v3x-q3m4", | ||
"GHSA-rjqq-98f6-6j3r", | ||
"GHSA-f9xv-q969-pqx4", | ||
"GHSA-p9pc-299p-vxgp" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ | |
}, | ||
"redis": { | ||
"port": 6379, | ||
"host": "localhost", | ||
"host": "redis", | ||
"timeout": 100 | ||
}, | ||
"inspect": { | ||
|
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
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
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
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
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
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.