Skip to content

This is a simple Node.js and Express application that can be run using Docker.

License

Notifications You must be signed in to change notification settings

mian-ali/docker_with_node.js-express.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express.js server run on Docker

This is a simple Node.js and Express application that can be run using Docker.

Installation

Before running the application, you must have Docker installed on your system. If you don't have it already, you can download it here.

Clone this repository to your local machine:

https://github.com/mian-ali/docker_with_node.js-express.js.git

Navigate into the cloned repository:

cd docker_with_node.js-express.js

Build the Docker image using the provided Dockerfile:

docker build -t express-docker-image .

This will create a Docker image with the name express-docker-image . you can also check this command image

docker image ls

Usage

To start the application, run the following command:

docker run --rm -d -p 5000:5000 --name express-docker-container express-docker-image

This will start the application inside a Docker container and map port 5000 on your local machine to port 5000 inside the container.

You can now access the application by visiting http://localhost:5000 in your web browser.

Configuration

By default, the application listens on port 3000. If you want to change the port, you can modify the PORT environment variable in the Dockerfile or pass it as a command line argument when starting the container:

docker run -p 8080:8080 -e PORT=8080 your_project

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

This is a simple Node.js and Express application that can be run using Docker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published