-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-cluster.yml
More file actions
113 lines (107 loc) · 2.84 KB
/
docker-compose-cluster.yml
File metadata and controls
113 lines (107 loc) · 2.84 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
version: '3.8'
# SoliDB 3-Node Cluster Configuration
# Usage:
# 1. Generate keyfile: openssl rand -hex 32 > solidb.key
# 2. Start cluster: docker-compose -f docker-compose-cluster.yml up -d
# 3. Scale: docker-compose -f docker-compose-cluster.yml up -d --scale solidb-node=5
services:
solidb-node1:
build: .
image: solidb/solidb:latest
container_name: solidb-node1
hostname: solidb-node1
ports:
- "6745:6745"
volumes:
- solidb-data-1:/data
- ./solidb.key:/etc/solidb/solidb.key:ro
environment:
- SOLIDB_PORT=6745
- SOLIDB_ADMIN_PASSWORD=${SOLIDB_ADMIN_PASSWORD:-admin}
- RUST_LOG=solidb=info
command: >
sh -c "solidb
--port 6745
--data-dir /data
--keyfile /etc/solidb/solidb.key
--cluster-peers solidb-node2:6745,solidb-node3:6745"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6745/_api/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- solidb-cluster
restart: unless-stopped
solidb-node2:
build: .
image: solidb/solidb:latest
container_name: solidb-node2
hostname: solidb-node2
ports:
- "6746:6745"
volumes:
- solidb-data-2:/data
- ./solidb.key:/etc/solidb/solidb.key:ro
environment:
- SOLIDB_PORT=6745
- SOLIDB_ADMIN_PASSWORD=${SOLIDB_ADMIN_PASSWORD:-admin}
- RUST_LOG=solidb=info
command: >
sh -c "solidb
--port 6745
--data-dir /data
--keyfile /etc/solidb/solidb.key
--cluster-peers solidb-node1:6745,solidb-node3:6745"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6745/_api/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- solidb-cluster
depends_on:
solidb-node1:
condition: service_healthy
restart: unless-stopped
solidb-node3:
build: .
image: solidb/solidb:latest
container_name: solidb-node3
hostname: solidb-node3
ports:
- "6747:6745"
volumes:
- solidb-data-3:/data
- ./solidb.key:/etc/solidb/solidb.key:ro
environment:
- SOLIDB_PORT=6745
- SOLIDB_ADMIN_PASSWORD=${SOLIDB_ADMIN_PASSWORD:-admin}
- RUST_LOG=solidb=info
command: >
sh -c "solidb
--port 6745
--data-dir /data
--keyfile /etc/solidb/solidb.key
--cluster-peers solidb-node1:6745,solidb-node2:6745"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6745/_api/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- solidb-cluster
depends_on:
solidb-node1:
condition: service_healthy
restart: unless-stopped
networks:
solidb-cluster:
driver: bridge
volumes:
solidb-data-1:
solidb-data-2:
solidb-data-3: