-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mojaloop/#2092): upgrade nodeJS version for core services (#501)
feat(mojaloop/#2092): upgrade nodeJS version for core services - mojaloop/project#2092 - standardised CI scripts - fixed lint issues - updated .nvmrc to latest LTS version - added standard CI scripts/config to package.json: release, snapshot, standard-version, etc - updated gitignore to include test/results and IGNORE patterns - updated README with standard auto-release information - Fixed imports - Cleaned up Package.json - updated links in CHANGELOG to correctly point to project repo - Removed "secrets" (i.e. JWS Signing Keys) as we don't want anybody to accidentally use a "test" key. Rather have an error thrown and for people to explicitly configure their own keys. This does mean that I had to add a "dummy" (with no meaningful body) key file that is empty for unit tests to pass, and will have no impact on the docker image of the service (i.e. it will fail if JWS is enabled, and no Key is injected/configured). Notes: - npm-audit-resolver v3.0.0-7 is a candidate release to resolve compatibility with npm v7+ as described in naugtur/npm-audit-resolver#34. This will need to be addressed going forward as `npm run audit:resolve` (i.e. `resolve-audit`) is currently not functioning. As a work-around, we need to manually run the following command `npm audit fix`. The `npm run audit:check` (i.e. `check-audit`) still works as expected. - 'get-port' dependency version is fixed to v5.1.1, this is because v9+ only supports ESM loaders and not CJS. This will need to be addressed in a future story. - Helm chart mountPaths need to be updated from `/opt/ml-api-adapter` to `/opt/app` as follows: ```YAML volumeMounts: - mountPath: /opt/app/config name: <deployment-name> - mountPath: /opt/app/secrets <-- only required for the notification service name: jws-signing-key ``` BREAKING CHANGE: Major version bump for node v16 LTS support, re-structuring of project directories to align to core Mojaloop repositories and docker image now uses `/opt/app` instead of `/opt/ml-api-adapter` which will impact config/secret mounts.
- Loading branch information
Showing
28 changed files
with
20,966 additions
and
4,035 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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,7 @@ | ||
module.exports = { | ||
// Add a TODO comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc). | ||
reject: [ | ||
// TODO: v6+ (ref: https://github.com/sindresorhus/get-port/releases/tag/v6.0.0) is an ESM library and thus not compatible with CommonJS. Future story needed to resolve. | ||
"get-port" | ||
] | ||
} |
This file was deleted.
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 @@ | ||
12.16.0 | ||
16.15.0 |
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,35 +1,35 @@ | ||
FROM node:12.16.1-alpine as builder | ||
FROM node:16.15.0-alpine as builder | ||
USER root | ||
|
||
WORKDIR /opt/ml-api-adapter | ||
WORKDIR /opt/app | ||
|
||
RUN apk --no-cache add git | ||
RUN apk add --no-cache -t build-dependencies make gcc g++ python libtool libressl-dev openssl-dev autoconf automake \ | ||
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 | ||
|
||
COPY package.json package-lock.json* /opt/ml-api-adapter/ | ||
COPY package.json package-lock.json* /opt/app/ | ||
|
||
RUN npm install | ||
RUN npm ci | ||
|
||
COPY src /opt/ml-api-adapter/src | ||
COPY config /opt/ml-api-adapter/config | ||
COPY secrets /opt/ml-api-adapter/secrets | ||
COPY src /opt/app/src | ||
COPY config /opt/app/config | ||
|
||
FROM node:12.16.0-alpine | ||
FROM node:16.15.0-alpine | ||
|
||
WORKDIR /opt/ml-api-adapter | ||
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: ml-user | ||
RUN adduser -D ml-user | ||
USER ml-user | ||
RUN adduser -D app-user | ||
USER app-user | ||
|
||
COPY --chown=ml-user --from=builder /opt/ml-api-adapter . | ||
COPY --chown=app-user --from=builder /opt/app . | ||
RUN npm prune --production | ||
|
||
EXPOSE 3000 | ||
CMD ["node", "src/api/index.js"] | ||
|
||
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.