git clone https://github.com/kankburhan/node-dockerize.git
project structure:
-node-dockerize
-readme.md
-Dockerfile
-docker-composer.yml
-.env
-app/
Open app/package.json
and find scripts
just add npm install
in start app, for example your scripts like below:
"scripts": {
"test": "echo \\\"Error: no test specified\\\" && exit 1",
"start": "nodemon app"
},
change start
to
"start": "npm install && nodemon app"
Final scripts
:
"scripts": {
"test": "echo \\\"Error: no test specified\\\" && exit 1",
"start": "npm install && nodemon app"
},
Open your terminal and goto node-dockerize
docker-compose up -d --build
open browser and goto
http://localhost:3000/