An open API service indexing awesome lists of open source software.

https://github.com/thomasvjoseph/simple-node-app

A simple node.js application into a Docker container.In the first part of this guide we will create a simple web application in Node.js, then we will build a Docker image for that application, and lastly we will instantiate a container from that image.
https://github.com/thomasvjoseph/simple-node-app

docker docker-image dockerfile expressjs nodejs npm

Last synced: 3 months ago
JSON representation

A simple node.js application into a Docker container.In the first part of this guide we will create a simple web application in Node.js, then we will build a Docker image for that application, and lastly we will instantiate a container from that image.

Awesome Lists containing this project

README

          

# simple-node-app

the docker file consists of...

FROM node:10-alpine

it will fetch the light version of the node js from docker repo

WORKDIR /usr/src/app

COPY package*.json ./

it will create directory like wise in the path, here the docker will save our app code,json files etc...

RUN npm install

We are using node.js as our programming language, so the package for node is npm. so it will download npm package, after that npm will fetch and download required dependencies to run our application.

COPY . .

From this command it will copy the source code to the work directory

EXPOSE 8080

Our app will listen to the port 8080, we are binding

CMD [ "node", "server.js" ]

define the command to run your app using CMD which defines your runtime. Here we will use node server.js to start your server: