Skip to content

Advanced multi-service Dockerized application with React, Node.js, MongoDB, Redis, and Nginx. Implements secrets, volumes, custom images, multi-stage builds, health checks, and log rotation using Docker Compose.

Notifications You must be signed in to change notification settings

Shakeelkhuhro/Multi-Service-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐳 Multi-Service Dockerized Application

A full-stack, production-ready Dockerized application using:

  • React frontend
  • Node.js + Express API
  • MongoDB for persistent data
  • Redis cache for performance
  • Nginx as a reverse proxy

Built with advanced Docker features including multi-stage builds, custom images, volumes, networks, secrets, health checks, and log rotation.


📦 Project Structure

multi-service-app/
├── api/              # Node.js Express backend
├── web/              # React frontend
├── nginx/            # Nginx reverse proxy config
├── secrets/          # Docker secrets (e.g., MongoDB password)
├── docker-compose.yml
└── .env              # Centralized environment variables

🚀 Features

✅ Multi-container setup using Docker Compose
Custom Dockerfiles for frontend and API
Multi-stage build for optimized frontend image
Persistent volumes for MongoDB and Redis
Docker secrets for secure credentials
Health checks for all services
Log rotation via Docker logging driver
✅ Services communicate over shared Docker network


🛠️ Getting Started

Prerequisites

  • Docker + Docker Compose
  • Node.js (for development)
  • Git

1. Clone the repo

git clone https://github.com/shakeelkhuhro/multi-service-app.git
cd multi-service-app

2. Set up secrets

Create the MongoDB root password file:

mkdir -p secrets
echo "your-secure-password" > secrets/mongo-root-password.txt

3. Build and start the app

docker compose up -d --build

4. Access the application

Service URL
Frontend http://localhost
API http://localhost/api
MongoDB internal (not exposed)
Redis internal (not exposed)

🧪 Health Checks

Each service includes a health check to ensure stability and reliability in orchestration environments.


🧰 Logging

All services use json-file logging with rotation:

  • max-size: 10m
  • max-file: 3

Logs can be viewed with:

docker compose logs <service>

🧼 Clean Up

docker compose down -v

📚 Project Source

This project is part of the Multi-Service Docker Project on roadmap.sh. It provides a real-world scenario for practicing advanced Docker features such as custom images, secrets, volumes, and reverse proxies.

📄 License

MIT License — feel free to use, share, and improve.


Shakeel Khuhro

About

Advanced multi-service Dockerized application with React, Node.js, MongoDB, Redis, and Nginx. Implements secrets, volumes, custom images, multi-stage builds, health checks, and log rotation using Docker Compose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published