This project demonstrates the fundamental steps of dockerizing a simple Node.js Express application. It's perfect for those looking to understand the workflow of packaging and running applications within Docker containers.
-
Clone this repository:
git clone https://github.com/Emminex23/simple-dockerized-nodejs-app.git
-
Install dependencies:
cd simple-dockerized-nodejs-app npm install
-
Dockerfile: The
Dockerfilecontains the instructions for building the Docker image. Refer to theDockerfilefor detailed explanations of each step. -
Build the image:
docker build -t nodejs-express-app . -
Run the container:
docker run -p 3000:3000 -d nodejs-express-app
Open your web browser and go to http://localhost:3000/. You should see the message "Hello from Express!".
server.js: The Node.js Express server code.package.json: Contains project dependencies.Dockerfile: Instructions for creating the Docker image.