This document provides comprehensive instructions for running AshtaPashaka with Docker and Docker Compose, including autoscaling, health checks, resource limits, and troubleshooting.
┌─────────────────┐
│ Frontend │ (Port 3000)
│ (React/Vite) │
└────────┬────────┘
│
┌────────▼────────┐
│ Nginx │ (Port 8080)
│ Load Balancer │
└────────┬────────┘
│
┌────┴─────┬──────────┐
│ │ │
┌───▼──┐ ┌───▼──┐ ┌───▼──┐
│Backend│ │Backend│ │Backend│
│ #1 │ │ #2 │ │ #3 │ (Scalable)
└───────┘ └───────┘ └───────┘
(Port 3001)
Optional:
┌──────────────────┐
│ Prometheus │ (Port 9090)
└──────────────────┘
- Docker Engine 20.10+
- Docker Compose 2.0+
- Git
- 2GB RAM minimum (4GB+ recommended)
# Clone and navigate to project
cd /path/to/AshtaPashaka
# Build and start services
docker-compose up -d --scale backend=2
# View logs
docker-compose logs -f
# Stop services
docker-compose down- Frontend: http://localhost:3000
- Backend (Direct): ws://localhost:3001
- Backend (Via Nginx): http://localhost:8080
- Prometheus Metrics: http://localhost:9090
To scale backend replicas:
docker-compose up -d --scale backend=5Nginx load balances using the least_conn algorithm. Update nginx.conf to add more backend servers if needed.
All services include health checks. View status:
docker ps --format "table {{.Names}}\t{{.Status}}"Resource constraints are set in docker-compose.yml. Adjust as needed for your hardware.
Prometheus is included for monitoring (optional). Access at http://localhost:9090
- Use Docker Swarm or Kubernetes for production autoscaling and orchestration.
- See Docker Documentation and Kubernetes Documentation.
Create a .env file for configuration. See examples in the original compose file.
# Start services
docker-compose up -d
# Scale backend
docker-compose up -d --scale backend=5
# View running containers
docker-compose ps
# View logs
docker-compose logs -f
# Stop and remove
docker-compose down -v- Check logs:
docker-compose logs - Verify ports:
lsof -i :3000,lsof -i :3001, etc. - Restart:
docker-compose restart
docker-compose down
docker image prune
docker system prune --all --volumes