This is a simple Node.js and Express application that can be run using Docker.
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
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.
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
This project is licensed under the MIT License - see the LICENSE.md file for details.