-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (83 loc) · 2.26 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (83 loc) · 2.26 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
x-common: &common
build:
context: .
dockerfile: Dockerfile
# small shortcut to speed builds up by reusing the same image for all nodes
image: snapchain-local:dev
init: true # Auto-reap zombie processes and forward process signals
environment:
RUST_BACKTRACE: "full"
# `make dev` runs `docker compose up --watch`. On changes to the paths the Dockerfile
# COPYs, rebuild the image and recreate the containers. `rebuild` (not `sync`) is required
# because the runtime image is a from-scratch Ubuntu with a compiled binary and no cargo,
# so source changes must recompile. cargo-chef layer caching keeps the dependency layer
# warm, so a typical edit only reruns the final build + setup_local_testnet layers.
develop:
watch:
- action: rebuild
path: ./src
- action: rebuild
path: ./cli
- action: rebuild
path: ./proto
- action: rebuild
path: ./Cargo.toml
- action: rebuild
path: ./Cargo.lock
services:
node1:
<<: *common
command: ["./snapchain", "--config-path", "./nodes/1/snapchain.toml"]
ports:
- "50051:50051/udp"
- "3381:3381/tcp"
- "3383:3383/tcp"
networks:
snapchain-subnet:
ipv4_address: 172.100.0.11
volumes:
- node1-data:/app/.rocks
node2:
<<: *common
command: ["./snapchain", "--config-path", "./nodes/2/snapchain.toml"]
ports:
- "50052:50052/udp"
- "3384:3384/tcp"
networks:
snapchain-subnet:
ipv4_address: 172.100.0.12
volumes:
- node2-data:/app/.rocks
node3:
<<: *common
command: ["./snapchain", "--config-path", "./nodes/3/snapchain.toml"]
ports:
- "50053:50053/udp"
- "3385:3385/tcp"
networks:
snapchain-subnet:
ipv4_address: 172.100.0.13
volumes:
- node3-data:/app/.rocks
node4:
<<: *common
command: ["./snapchain", "--config-path", "./nodes/4/snapchain.toml"]
ports:
- "50054:50054/udp"
- "3386:3386/tcp"
networks:
snapchain-subnet:
ipv4_address: 172.100.0.14
volumes:
- node4-data:/app/.rocks
volumes:
node1-data:
node2-data:
node3-data:
node4-data:
networks:
snapchain-subnet:
driver: bridge
ipam:
config:
- subnet: 172.100.0.0/24