Skip to content

PrabalPiya/dockerized-simple-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized Simple Web Application

This is a beginner DevOps project where I containerized a simple Node.js Express web application using Docker.

The goal of this project is to understand the basic DevOps workflow of packaging an application into a Docker image and running it as a container locally.

Tools Used

  • Node.js
  • Express.js
  • Docker
  • VS Code
  • Git/GitHub
  • Terminal

Architecture

Developer writes application code
→ Dockerfile is created
→ Docker image is built
→ Docker container is started
→ Application runs on localhost
→ Logs and health endpoint are used for verification

Folder Structure

devops-docker-basic-app/
│
├── app/
│   ├── package.json
│   ├── server.js
│
├── Dockerfile
├── .dockerignore
└── README.md

How to Run the Project

1. Clone the Repository

git clone <your-repository-url>
cd devops-docker-basic-app

2. Build the Docker Image

docker build -t devops-basic-app:v1 .

3. Run the Docker Container

docker run -d -p 3000:3000 --name devops-basic-container devops-basic-app:v1

4. Test the Application

curl http://localhost:3000

Health check:

curl http://localhost:3000/health

5. Check Container Logs

docker logs devops-basic-container

6. Stop and Remove the Container

docker stop devops-basic-container
docker rm devops-basic-container

What I Learned

  • How to create a simple Node.js web application
  • How to write a Dockerfile
  • How to build a Docker image
  • How to run a Docker container
  • How port mapping works in Docker
  • How to check container logs
  • How to add a basic health check endpoint
  • How to troubleshoot common Docker issues

About

Simple DevOps project that runs a Node.js Express web application inside a Docker container.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors