Skip to content

kankburhan/node-dockerize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Compose Node

How To Use:

1. Clone this Repository

git clone https://github.com/kankburhan/node-dockerize.git

2. Clone your node application into app folder

project structure:

    -node-dockerize
        -readme.md
        -Dockerfile
        -docker-composer.yml
        -.env
        -app/

3. Copy .env.example to .env

4. Add npm install on your package

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"
  },

5. Build and run your docker

Open your terminal and goto node-dockerize docker-compose up -d --build

6. Test your application

open browser and goto http://localhost:3000/

About

Create Docker Compose for Node Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published