Overview
Argos Mesh uses Docker Compose to orchestrate its complete microservices architecture. The stack includes three Spring Boot microservices, PostgreSQL database, RabbitMQ message broker, and Redis cache.The docker-compose configuration is located in
/infra/docker-compose.yml in the source repository.Architecture Overview
The Docker Compose stack deploys:- Orders Service (
shop_app): Main shop application with REST API (port 8080) - Sentinel Service (
sentinel_app): DDoS protection using Java 21 Virtual Threads - Notify Service (
notify_app): Notification worker for security alerts - PostgreSQL (
shop_db): Primary database (port 5432) - RabbitMQ (
message_broker): Message queue with management UI (ports 5672, 15672) - Redis (
black_list): Blacklist cache for suspicious IPs (port 6379)
Complete Docker Compose Configuration
Services Breakdown
PostgreSQL Database Service
PostgreSQL Database Service
- Uses PostgreSQL 15 Alpine for minimal image size
- Persistent volume
postgres_datafor data durability - Health check ensures database is ready before dependent services start
- Database accessible on localhost:5432
Orders Service (Main Application)
Orders Service (Main Application)
- Built from source using multi-stage Dockerfile
- Waits for database health check before starting
- REST API exposed on port 8080
- Connects to PostgreSQL, RabbitMQ, and Redis
Sentinel Service (DDoS Protection)
Sentinel Service (DDoS Protection)
- Uses Java 21 Virtual Threads for high concurrency
- Monitors request patterns and detects suspicious IPs
- Publishes alerts to RabbitMQ for notification service
- Maintains blacklist in Redis for fast lookups
Notify Service (Alert Worker)
Notify Service (Alert Worker)
- Headless service (no exposed ports)
- Consumes messages from RabbitMQ queues
- Sends notifications for DDoS attacks and suspicious activity
RabbitMQ Message Broker
RabbitMQ Message Broker
- Includes management plugin for web-based monitoring
- Management UI accessible at http://localhost:15672
- Login:
admin/admin123 - Health check ensures broker is ready for consumers
Redis Cache Service
Redis Cache Service
- Persistence enabled with append-only file (AOF)
- Stores IP blacklist for rapid access
- Persistent volume ensures blacklist survives restarts
Deployment Steps
Prerequisites
Ensure you have the following installed:
- Docker Engine 20.10+
- Docker Compose 2.0+
Access Services
- Orders API: http://localhost:8080
- RabbitMQ Management: http://localhost:15672 (admin/admin123)
- PostgreSQL: localhost:5432 (user_shop/secretPassword)
- Redis: localhost:6379
Managing the Stack
Viewing Logs
Restarting Services
Stopping Services
Environment Variables Reference
Database Configuration
| Variable | Value | Description |
|---|---|---|
POSTGRES_USER | user_shop | PostgreSQL username |
POSTGRES_PASSWORD | secretPassword | PostgreSQL password (change in production!) |
POSTGRES_DB | shop_db | Database name |
RabbitMQ Configuration
| Variable | Value | Description |
|---|---|---|
RABBITMQ_DEFAULT_USER | admin | RabbitMQ admin username |
RABBITMQ_DEFAULT_PASS | admin123 | RabbitMQ admin password |
SPRING_RABBITMQ_HOST | message_broker | Hostname for RabbitMQ |
SPRING_RABBITMQ_PORT | 5672 | AMQP protocol port |
Redis Configuration
| Variable | Value | Description |
|---|---|---|
SPRING_DATA_REDIS_HOST | redis_db | Redis hostname |
SPRING_DATA_REDIS_PORT | 6379 | Redis port |
Networking
All services communicate through theargos-network bridge network:
- Database:
dborshop_db - RabbitMQ:
message_broker - Redis:
redis_dborblack_list
Persistent Volumes
Two named volumes preserve data across container restarts:Health Checks
All critical services have health checks configured:| Service | Health Check Command | Interval |
|---|---|---|
| PostgreSQL | pg_isready -U user_shop -d shop_db | 10s |
| RabbitMQ | rabbitmq-diagnostics -q ping | 10s |
| Redis | redis-cli ping | 5s |
Troubleshooting
Services won't start
Services won't start
- Check if ports are already in use:
- View service logs:
- Ensure Docker has enough resources (memory, CPU)
Database connection errors
Database connection errors
- Verify database is healthy:
- Check if database initialization completed:
- Test connection manually:
RabbitMQ connection failures
RabbitMQ connection failures
Build failures
Build failures
- Clean Docker build cache:
- Ensure source code is present in parent directories
- Check Dockerfile syntax in each service directory
Out of disk space
Out of disk space
Clean up unused Docker resources:
Production Considerations
-
Security:
- Change all default passwords
- Use Docker secrets for sensitive data
- Enable TLS for external connections
- Don’t expose database ports publicly
-
Resource Limits:
-
Monitoring:
- Add health check endpoints to Spring Boot apps
- Integrate with Prometheus/Grafana
- Set up log aggregation (ELK stack)
-
Backup Strategy:
- Regular PostgreSQL dumps
- Volume backups for Redis
- Test restore procedures
Next Steps
Local Development Setup
Set up individual services for development
API Reference
Explore the Orders API endpoints