nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

doc: Docker - Shouldn't we use included npm ?

Open Glideh opened this issue 5 years ago • 0 comments

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

Glideh avatar Nov 09 '20 14:11 Glideh