This Dockerfile provides a good base build image to use in multistage builds for Node apps. It comes with the latest version of Alpine, Node and NPM. It is intended for use in creating release images with or for your application and allows you to avoid cross-compiling releases. The exception of course is if your app has dependencies which require a native compilation toolchain, but that is an exercise left to the user.
No effort has been made to make this image suitable to run in unprivileged environments. The repository owner is not responsible for any losses that result from improper usage or security practices, as it is expected that the user of this image will implement proper security practices themselves.
Alpine 3.13.1
Nodejs 15.8.0
NPM 7.5.2
Git 2.30.0
To boot straight to a node prompt in the image:
$ docker run --rm -i -t beardedeagle/alpine-node-builder node
Welcome to Node.js v15.8.0.
Type ".help" for more information.
>