-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose-cluster.yml
More file actions
74 lines (69 loc) · 3.61 KB
/
docker-compose-cluster.yml
File metadata and controls
74 lines (69 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# クラスター構成(3ノード)用の設定
# 共通設定をアンカーで定義
x-dynamodb-env: &dynamodb-env
J5IK2O_DYNAMO_DB_JOURNAL_DYNAMO_DB_CLIENT_ENDPOINT: http://localstack:4566
J5IK2O_DYNAMO_DB_SNAPSHOT_DYNAMO_DB_CLIENT_ENDPOINT: http://localstack:4566
J5IK2O_DYNAMO_DB_STATE_DYNAMO_DB_CLIENT_ENDPOINT: http://localstack:4566
AWS_REGION: ap-northeast-1
AWS_ACCESS_KEY_ID: dummy
AWS_SECRET_ACCESS_KEY: dummy
x-cluster-env: &cluster-env
PEKKO_CLUSTER_ENABLED: "true"
PEKKO_MANAGEMENT_HTTP_HOSTNAME: 0.0.0.0
PEKKO_MANAGEMENT_HTTP_PORT: 8558
PEKKO_CLUSTER_SEED_NODES: "pekko://command-api-system@command-api-1:2551"
PEKKO_CLUSTER_BOOTSTRAP_REQUIRED_CONTACTS: 2
COMMAND_API_SERVER_HOST: 0.0.0.0
COMMAND_API_SERVER_PORT: 18080
COMMAND_API_DETACH_WAIT_DURATION: "5s"
COMMAND_API_HEALTH_CHECK_GRACE_PERIOD: "10s"
x-command-api-base: &command-api-base
image: p-cqrs-es-command-api:0.1.0
networks:
- p-cqrs-es-network
environment:
<<: [*dynamodb-env, *cluster-env]
depends_on:
dynamodb-setup:
condition: service_completed_successfully
services:
# Command API Cluster - Node 1 (Seed Node)
command-api-1:
<<: *command-api-base
ports:
- "${CLUSTER_NODE1_API_PORT:-50501}:18080" # HTTP/gRPC
- "${CLUSTER_NODE1_MANAGEMENT_PORT:-8558}:8558" # Pekko Management
- "${CLUSTER_NODE1_REMOTE_PORT:-2551}:2551" # Pekko Remote
environment:
<<: [*dynamodb-env, *cluster-env]
PEKKO_REMOTE_HOSTNAME: command-api-1
PEKKO_REMOTE_PORT: 2551
JAVA_OPTS: "-Dpekko.cluster.enabled=true -Dpekko.actor.provider=cluster -Dpekko.remote.artery.canonical.hostname=command-api-1 -Dpekko.remote.artery.canonical.port=2551 -Dpekko.cluster.seed-nodes.0=pekko://command-api-system@command-api-1:2551 -Dpekko.management.http.hostname=0.0.0.0 -Dpekko.management.http.port=8558 -Dcommand-api.detach-wait-duration=5s -Dcommand-api.health-check-grace-period=10s"
# Command API Cluster - Node 2
command-api-2:
<<: *command-api-base
ports:
- "${CLUSTER_NODE2_API_PORT:-50511}:18080" # HTTP/gRPC
- "${CLUSTER_NODE2_MANAGEMENT_PORT:-8559}:8558" # Pekko Management
- "${CLUSTER_NODE2_REMOTE_PORT:-2552}:2551" # Pekko Remote
depends_on:
- command-api-1
environment:
<<: [*dynamodb-env, *cluster-env]
PEKKO_REMOTE_HOSTNAME: command-api-2
PEKKO_REMOTE_PORT: 2551
JAVA_OPTS: "-Dpekko.cluster.enabled=true -Dpekko.actor.provider=cluster -Dpekko.remote.artery.canonical.hostname=command-api-2 -Dpekko.remote.artery.canonical.port=2551 -Dpekko.cluster.seed-nodes.0=pekko://command-api-system@command-api-1:2551 -Dpekko.management.http.hostname=0.0.0.0 -Dpekko.management.http.port=8558 -Dcommand-api.detach-wait-duration=5s -Dcommand-api.health-check-grace-period=10s"
# Command API Cluster - Node 3
command-api-3:
<<: *command-api-base
ports:
- "${CLUSTER_NODE3_API_PORT:-50521}:18080" # HTTP/gRPC
- "${CLUSTER_NODE3_MANAGEMENT_PORT:-8560}:8558" # Pekko Management
- "${CLUSTER_NODE3_REMOTE_PORT:-2553}:2551" # Pekko Remote
depends_on:
- command-api-1
environment:
<<: [*dynamodb-env, *cluster-env]
PEKKO_REMOTE_HOSTNAME: command-api-3
PEKKO_REMOTE_PORT: 2551
JAVA_OPTS: "-Dpekko.cluster.enabled=true -Dpekko.actor.provider=cluster -Dpekko.remote.artery.canonical.hostname=command-api-3 -Dpekko.remote.artery.canonical.port=2551 -Dpekko.cluster.seed-nodes.0=pekko://command-api-system@command-api-1:2551 -Dpekko.management.http.hostname=0.0.0.0 -Dpekko.management.http.port=8558 -Dcommand-api.detach-wait-duration=5s -Dcommand-api.health-check-grace-period=10s"