Skip to content

kbmakevin/nodejs-docker-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-docker-webapp

  1. Create the Node.js app

  2. Create a Dockerfile

    • FROM node:carbon
    • WORKDIR /usr/src/app
    • COPY package*.json ./
    • RUN npm install
    • COPY . .
    • CMD [ "npm", "start" ]
  3. Create .dockerignore file

  4. Build docker image

    • docker build -t <your username>/node-web-app
  5. Run the image

    • docker run -p public:private -d <your username>/node-web-app
    • docker ps
    • docker logs <container id>
    • docker exec -it <container id> /bin/bash
  6. Test

Referenced this article: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/

About

Dockerizing a Node.js web app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published