A 3-tier containerized web application with Node.js, demonstrating multi-stack Docker deployment capability.
Browser → Nginx (80) → Node.js Express (3000) → MongoDB (27017)
Proxy Web App Database
git clone https://github.com/zeroxin2003/project-02-node-docker.git
cd project-02-node-docker
docker compose up -d --build
# Visit http://localhost:3000| Component | Tech | Purpose |
|---|---|---|
| Reverse Proxy | Nginx Alpine | Single entry point, load balancing ready |
| Web App | Express 4 + Node 20 Alpine | RESTful application |
| Database | MongoDB 7 | Document store with persistent data |
| Orchestration | Docker Compose | Multi-container management |
| CI/CD | GitHub Actions | Auto build, test, deploy |
- Health checks on all 3 services with proper startup ordering
- Persistent data via named Docker volume (
mongo_data) - Nginx reverse proxy hides internal Node.js port
- REST API at
/api/visitsreturns visit count as JSON - Environment variables for database connection
- Alpine-based images for minimal footprint
docker compose up -d --build # Start all services
docker compose ps # Check status and health
docker compose logs -f # View logs
docker compose down # Stop (data preserved)
docker compose down -v # Stop and remove data├── app.js # Express application
├── package.json # Node.js dependencies
├── Dockerfile # Node container build
├── docker-compose.yml # Multi-service orchestration
├── nginx/
│ └── default.conf # Nginx reverse proxy config
├── .github/
│ └── workflows/
│ └── ci.yml # CI/CD pipeline
├── .dockerignore
└── .gitignore