Docker Compose-based development environment for the ServiceMap application.
This repository contains the infrastructure setup for running ServiceMap in a development environment. It includes all necessary services orchestrated via Docker Compose.
- Traefik (Port 80, 443, 8080) - Reverse proxy and load balancer
- PostgreSQL (Port 5432) - Primary database (PostgreSQL 16)
- Keycloak (Port 8081) - Identity and access management
- RabbitMQ (Ports 5672, 15672) - Message broker with management UI
- Redis (Port 6379) - In-memory data store (Redis 7.4)
- Redis Insight (Port 5540) - Redis management and monitoring UI
- Prometheus (Port 9090) - Metrics collection and storage
- Grafana (Port 3000) - Metrics visualization and dashboards
- MailHog (Ports 1025, 8025) - Email testing tool
- Gateway (Port 8085) - ASP.NET Core API Gateway
- UI (Port 5173) - React frontend application
- Docker
- Docker Compose
- Git
- Clone the repository:
git clone <repository-url>
cd infra- Start all services:
docker-compose -f docker-compose.dev.yml --env-file .env.dev up -d- Stop all services:
docker-compose -f docker-compose.dev.yml --env-file .env.dev down- Stop and remove volumes:
docker-compose -f docker-compose.dev.yml --env-file .env.dev down -v| Service | URL | Domain | Username | Password |
|---|---|---|---|---|
| Traefik Dashboard | http://localhost:8080 | http://traefik.localhost | - | - |
| PostgreSQL | localhost:5432 | - | admin | admin |
| Keycloak Admin | http://localhost:8081 | http://keycloak.localhost | admin | admin |
| RabbitMQ Management | http://localhost:15672 | http://rabbitmq.localhost | admin | admin |
| Redis | localhost:6379 | - | - | - |
| Redis Insight | http://localhost:5540 | http://redis-insight.localhost | - | - |
| Prometheus | http://localhost:9090 | http://prometheus.localhost | - | - |
| Grafana | http://localhost:3000 | http://grafana.localhost | admin | admin |
| MailHog Web UI | http://localhost:8025 | http://mailhog.localhost | - | - |
| Gateway API | http://localhost:8085 | http://api.localhost | - | - |
| UI Application | http://localhost:5173 | http://localhost | - | - |
Environment variables are defined in .env.dev. Key configurations:
POSTGRES_USER=adminPOSTGRES_PASSWORD=adminPOSTGRES_DB=servicemap
KEYCLOAK_ADMIN=adminKEYCLOAK_ADMIN_PASSWORD=admin
RABBITMQ_DEFAULT_USER=adminRABBITMQ_DEFAULT_PASS=admin
GRAFANA_ADMIN_USER=adminGRAFANA_ADMIN_PASSWORD=admin
The following Docker volumes are used for data persistence:
postgres_data- PostgreSQL database filesredis_data- Redis data filesredis_insight_data- Redis Insight configurationrabbitmq_data- RabbitMQ data and configurationprometheus_data- Prometheus metrics datagrafana_data- Grafana dashboards and configuration
All services communicate through a dedicated Docker network: servicemap-net
Custom initialization scripts are located in postgres/init.sql and run automatically on first startup.
Realm configuration is automatically imported from keycloak/realm-export.json on startup.
A one-time configuration script (redis-insight-init) automatically adds the Redis instance to Redis Insight.
- Prometheus datasource is automatically provisioned
- Pre-configured Traefik Ingress Traffic dashboard is automatically loaded
Traefik exposes Prometheus metrics on port 8082 (internal), which are scraped by Prometheus every 15 seconds. The metrics include:
- Request rates per entrypoint and router
- HTTP status code distribution
- Request duration percentiles (p50, p95, p99)
- Network traffic (bytes sent/received)
Access Grafana at http://localhost:3000 (admin/admin) to view the pre-configured Traefik Ingress Traffic dashboard, which displays:
- Total request rates and counts
- Requests by router
- HTTP status code distribution
- Request duration percentiles
- Network traffic analysis
All services use JSON file logging with:
- Maximum file size: 10MB
- Maximum files: 3
docker-compose -f docker-compose.dev.yml --env-file .env.dev up -d --build# All services
docker-compose -f docker-compose.dev.yml logs -f
# Specific service
docker-compose -f docker-compose.dev.yml logs -f <service-name>docker exec -it servicemap-<service-name> /bin/bashCheck service logs:
docker-compose -f docker-compose.dev.yml --env-file .env.dev logsEnsure PostgreSQL is fully started before dependent services:
docker-compose -f docker-compose.dev.yml --env-file .env.dev psEnsure the required ports are not in use by other applications.
See LICENSE file for details.