A simple Express.js backend application containerized using Docker, connected to MongoDB, and integrated with Mongo Express for visual database access. This project demonstrates multi-container orchestration using Docker Compose and basic CRUD functionality via REST API.
https://hub.docker.com/repository/docker/adityagarasangi0/docker-node-mongo-app/general- Node.js (Express)
- MongoDB
- Mongo Express
- Docker & Docker Compose
git clone https://github.com/yourusername/docker-node-mongo-app.git
cd docker-node-mongo-appdocker compose up -d --build- Node.js App: http://localhost:5050
- Mongo Express UI: http://localhost:8081
| Method | Endpoint | Description |
|---|---|---|
| GET | /getUsers |
Get all users |
| POST | /addUser |
Add a new user |
MongoDB data is persisted on the host using a volume:
volumes:
- /run/desktop/mnt/host/e/data:/data/dbSample JSON output from the
/getUsersendpoint showing user records fetched from MongoDB.
docker-node-mongo-app/
├── node_modules/
├── public/
│ ├── index.html
│ └── style.css
├── docker-compose.yml
├── Dockerfile
├── package.json
├── package-lock.json
└── server.js- Add health checks for services
- Add .env file support for better config management
- Integrate CI/CD pipeline using GitHub Actions
- App connects to MongoDB via internal Docker DNS (mongo as the hostname)
- Mongo Express provides a UI for inspecting collections and documents
- All services are defined and managed via docker-compose.yml







