Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
[#24] Improve dependencies install in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
howardgao committed Nov 4, 2024
1 parent 80e8542 commit 0eaa4ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
23 changes: 6 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,18 @@ RUN yarn install --network-timeout 1000000
## Build application
RUN yarn build

FROM registry.access.redhat.com/ubi8/nodejs-20-minimal:latest
## Gather productization dependencies
RUN yarn install --network-timeout 1000000 --modules-folder node_modules_prod --production

USER root
FROM registry.access.redhat.com/ubi8/nodejs-20-minimal:latest

COPY --from=BUILD_IMAGE /usr/src/app/dist /usr/share/amq-spp/dist
COPY --from=BUILD_IMAGE /usr/src/app/.env /usr/share/amq-spp/.env
COPY --from=BUILD_IMAGE /usr/src/app/node_modules_prod /usr/share/amq-spp/node_modules

WORKDIR /usr/share/amq-spp

RUN npm install connect \
cors \
express \
express-openapi-validator \
swagger-routes-express \
typescript \
validator \
yaml \
base-64 \
jsonwebtoken \
dotenv \
express-rate-limit \
node-fetch@2 \
@peculiar/x509
USER root

RUN echo "node /usr/share/amq-spp/dist/app.js" > run.sh
RUN chmod +x run.sh
Expand All @@ -63,4 +52,4 @@ CMD ["node", "dist/app.js"]
LABEL name="artemiscloud/activemq-artemis-jolokia-api-server"
LABEL description="ActiveMQ Artemis Jolokia api-server"
LABEL maintainer="Howard Gao <[email protected]>"
LABEL version="0.1.1"
LABEL version="0.1.1"
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,43 @@
"@types/webpack": "5.28.1",
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"base-64": "^1.0.0",
"chromatic": "6.10.1",
"copy-webpack-plugin": "11.0.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-unused-imports": "^3.2.0",
"express": "4.18.2",
"express-openapi-validator": "5.1.2",
"express-rate-limit": "^7.2.0",
"husky": "8.0.0",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"js-yaml": "4.1.0",
"jsonwebtoken": "^9.0.2",
"lint-staged": "13.1.0",
"nock": "^13.5.4",
"node-fetch": "2",
"openapi-to-md": "^1.0.24",
"pluralize": "^8.0.0",
"prettier": "^2.7.1",
"prettier-stylelint": "^0.4.2",
"pretty-quick": "3.1.3",
"sort-package-json": "^2.10.0",
"swagger-routes-express": "^3.3.2",
"ts-jest": "^29.2.1",
"ts-loader": "^9.3.1",
"ts-node": "10.9.2",
"typescript": "^4.7.4",
"yaml": "^2.4.5"
"typescript": "^4.7.4"
},
"readme": "README.md",
"_id": "[email protected]",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"dependencies": {
"cors": "^2.8.5",
"base-64": "^1.0.0",
"dotenv": "^16.4.5",
"express": "4.18.2",
"express-openapi-validator": "5.1.2",
"express-rate-limit": "^7.2.0",
"yaml": "^2.4.5",
"js-yaml": "4.1.0",
"jsonwebtoken": "^9.0.2",
"node-fetch": "2",
"swagger-routes-express": "^3.3.2",
"express-pino-logger": "^7.0.0",
"pino": "^9.5.0"
}
Expand Down

0 comments on commit 0eaa4ce

Please sign in to comment.