Skip to content

Conversation

@atombrella
Copy link
Contributor

@atombrella atombrella commented Aug 9, 2022

All the node dependencies can clutter your local machine, and you may need different versions of node installed.

The Dockerfile was mainly inspired by the official documentation for NodeJS. https://nodejs.org/en/docs/guides/nodejs-docker-webapp/

Please be aware that there are several dependencies which are listed with npm audit. I'm not sure how much bandwidth you have for this project, but I'd suggest adding dependabot to the project.

@janbrasna janbrasna marked this pull request as draft October 4, 2024 20:02
@gstrauss
Copy link
Collaborator

gstrauss commented Dec 6, 2024

@atombrella I recently updated most of the package version dependencies. Do you have any interest in testing out the current codebase?

@atombrella
Copy link
Contributor Author

@atombrella I recently updated most of the package version dependencies. Do you have any interest in testing out the current codebase?

Yes, I'll try :)

@atombrella
Copy link
Contributor Author

@gstrauss I updated it to use Node 22, and it runs smoothly. My branch is open for edits from repository maintainers.

I don't know why the NodeJS Alpine based base image cannot be used. It fails with :

[webpack-cli] Failed to load '/app/config/webpack.config.js' config
[webpack-cli] TypeError: Cannot read properties of undefined (reading 'trim')
    at revision (/app/config/webpack.config.js:14:85)
    at Object.<anonymous> (/app/config/webpack.config.js:25:15)
    at Module._compile (node:internal/modules/cjs/loader:1565:14)
    at Object..js (node:internal/modules/cjs/loader:1708:10)
    at Module.load (node:internal/modules/cjs/loader:1318:32)
    at Function._load (node:internal/modules/cjs/loader:1128:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:138:16)
The command '/bin/sh -c npm install --save-dev copy-webpack-plugin &&     npm install --save-dev webpack webpack-cli &&     npm run build --save-dev' returned a non-zero code: 2

Can the draft mode be removed?

@gstrauss gstrauss marked this pull request as ready for review December 9, 2024 18:52
@gstrauss
Copy link
Collaborator

gstrauss commented Dec 9, 2024

[webpack-cli] TypeError: Cannot read properties of undefined (reading 'trim')

My guess is that the git command is failing, probably because it is missing, or because you are not running inside a git working-copy. Do you have git installed in the container? As the git revision is only included in the HTML at bottom right of the page, I think I'll modify the code to be tolerant of failure to retrieve the git revision.

@gstrauss
Copy link
Collaborator

gstrauss commented Dec 9, 2024

Why does the RUN command explicitly install copy-webpack-plugin and webpack-cli? Why not simply npm install and npm build, as documented in README.md?

@atombrella
Copy link
Contributor Author

@gstrauss I've updated it, and the missing git as the reason why Alpine didn't work.

@gstrauss
Copy link
Collaborator

@atombrella Thank you. I am going to check with others for some input, but expect to resolve this PR before the end of January (and hopefully much sooner).

@gstrauss
Copy link
Collaborator

LGTM! Thank you for your contribution! (and thank you for your patience)

@gstrauss gstrauss merged commit ba3da86 into mozilla:master Jan 26, 2025
3 checks passed
@atombrella atombrella deleted the feature/dockerfile branch January 29, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants