This directory contains a local development infrastructure stack using Docker Compose. It includes all necessary services for running and testing microservices locally.
- Traefik: Reverse proxy and load balancer (Dashboard: http://localhost:8080)
- Consul: Service discovery and configuration (UI: http://localhost:8500)
- Postgres: Database (Port: 5432)
- Redis: Cache (Port: 6379)
- Prometheus: Metrics collection (UI: http://localhost:9090)
- Grafana: Metrics visualization (http://grafana.localhost, default: admin/admin)
- Loki: Log aggregation
- Jaeger: Distributed tracing (UI: http://localhost:16686)
- Example Services: service-a and service-b showing service-to-service communication
- Docker and Docker Compose
- Add to /etc/hosts:
127.0.0.1 service-a.localhost
127.0.0.1 service-b.localhost
127.0.0.1 grafana.localhost
Start the stack:
./scripts/up.shStop and clean up:
./scripts/down.shView logs:
./scripts/logs.sh- Access service-a: http://service-a.localhost
- Access service-b: http://service-b.localhost
- View traces in Jaeger: http://localhost:16686
- Check metrics in Grafana: http://grafana.localhost
infrastructure-local/
├── compose/ # Docker Compose files
├── configs/ # Configuration for services
├── services/ # Example microservices
└── scripts/ # Helper scripts
- Add service definition to
compose/docker-compose.yml - Add Traefik configuration if needed in
configs/traefik/dynamic.yml - Add Prometheus scrape config in
configs/prometheus/prometheus.yml - Start the stack with
./scripts/up.sh
- Check service logs:
./scripts/logs.sh - Verify Docker network:
docker network ls - Check Traefik dashboard: http://localhost:8080
- Verify Consul service registration: http://localhost:8500