nodejs.org
nodejs.org copied to clipboard
doc: Docker - Shouldn't we use included npm ?
Instead of suggesting to use host's npm to initialize a new node app, shouldn't we use the one included into the image that we are going to use ?
Example with a basic docker-compose.yml
version: '3'
services:
app:
image: node:15.1.0-alpine
volumes:
- ./app:/home/node/app
docker-compose run app npm init
Then
docker-compose run app npm install [...]
Maybe user doesn't have npm installed on his host or most likely not the same version