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.
- Host: GitHub
- URL: https://github.com/thomasvjoseph/simple-node-app
- Owner: thomasvjoseph
- Created: 2022-12-15T15:11:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T11:40:56.000Z (almost 3 years ago)
- Last Synced: 2025-12-27T17:25:05.935Z (6 months ago)
- Topics: docker, docker-image, dockerfile, expressjs, nodejs, npm
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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: