Files
git.stella-ops.org/docs/router/examples/docker-compose.yaml
2025-12-25 23:10:09 +02:00

76 lines
1.9 KiB
YAML

version: '3.8'
services:
gateway:
build:
context: .
dockerfile: src/Examples.Gateway/Dockerfile
ports:
- "8080:8080" # HTTP ingress
- "5100:5100" # TCP transport
- "5101:5101" # TLS transport
environment:
- ASPNETCORE_URLS=http://+:8080
- GatewayNode__Region=demo
- GatewayNode__NodeId=gw-01
- GatewayNode__ListenPort=5100
volumes:
- ./src/Examples.Gateway/router.yaml:/app/router.yaml:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
billing:
build:
context: .
dockerfile: src/Examples.Billing.Microservice/Dockerfile
environment:
- Stella__ServiceName=billing
- Stella__Region=demo
- Stella__Routers__0__Host=gateway
- Stella__Routers__0__Port=5100
- Stella__Routers__0__TransportType=InMemory
volumes:
- ./src/Examples.Billing.Microservice/microservice.yaml:/app/microservice.yaml:ro
depends_on:
gateway:
condition: service_healthy
inventory:
build:
context: .
dockerfile: src/Examples.Inventory.Microservice/Dockerfile
environment:
- Stella__ServiceName=inventory
- Stella__Region=demo
- Stella__Routers__0__Host=gateway
- Stella__Routers__0__Port=5100
- Stella__Routers__0__TransportType=InMemory
depends_on:
gateway:
condition: service_healthy
# Optional: RabbitMQ for message-based transport
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "5672:5672" # AMQP
- "15672:15672" # Management UI
environment:
- RABBITMQ_DEFAULT_USER=stellaops
- RABBITMQ_DEFAULT_PASS=stellaops
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_running"]
interval: 10s
timeout: 5s
retries: 3
networks:
default:
name: stellaops-router-example
volumes:
rabbitmq-data: