I can create a docker container with PHP and composer with this:
FROM php:fpm
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
Is there any equivalent way to archive the same for node.js and npm? The only solutions I figured so far are:
- install it the recommended way (https://github.com/nodesource/distributions/blob/master/README.md)
- clone via git and install it from there
- using this method (https://stackoverflow.com/a/61054246)
If I use the last method, the container gets bloated in size as I copy everything over (around 908 MB). So I wonder if there is a smarter way. What folders/files would I have to copy over to just implement node and npm functionality?