Dockerized Web Application using Node.js + Express + PostgreSQL with Docker Compose and Macvlan Networking.
containerization-project-1
│
├── backend
│ ├── Dockerfile
│ ├── package.json
│ ├── package-lock.json
│ ├── server.js
│ └── .dockerignore
│
├── database
│ └── Dockerfile
│
├── docker-compose.yml
├── project-ss
│ └── screenshots
│
└── README.md
The objective of this project is to:
docker network create \
--driver macvlan \
--subnet 172.30.0.0/24 \
--gateway 172.30.0.1 \
-o parent=eth0 \
lan_net

docker network ls

docker network inspect lan_net

docker-compose up --build

This confirms that the backend and PostgreSQL containers start successfully.
docker ps

Running containers:
docker network inspect containerization-project-1_default


This shows the containers connected to the Docker network.
Endpoint:
GET /health
Test in browser:
http://localhost:3000/health

The response OK confirms the backend service is running.
curl -X POST http://localhost:3000/students \
-H "Content-Type: application/json" \
-d '{"name":"Vanshika","age":21}'

The student record is successfully inserted into PostgreSQL.
curl http://localhost:3000/students

The inserted student record is retrieved successfully.
Students endpoint tested in browser:
http://localhost:3000/students

Backend container IP:
docker inspect backend_api | grep IPAddress

Database container IP:
docker inspect postgres_db | grep IPAddress

This confirms both containers are connected to the Docker network.
docker-compose down
docker-compose up


This confirms persistent storage for PostgreSQL data.
docker images

This shows the Docker images used in this project.
The following components were successfully verified:
Vanshika Munjal
SapId: 500121784
B.Tech – UPES