-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (46 loc) · 995 Bytes
/
docker-compose.yml
File metadata and controls
50 lines (46 loc) · 995 Bytes
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
version: '3.8'
services:
# First peer - acts as listener
peer1:
build: .
container_name: p2p-chat-peer1
environment:
- RUST_LOG=info
command: ["--port", "8080", "--nickname", "Alice"]
ports:
- "8080:8080"
networks:
- p2p-network
stdin_open: true
tty: true
# Second peer - connects to first peer
peer2:
build: .
container_name: p2p-chat-peer2
environment:
- RUST_LOG=info
command: ["--connect", "peer1:8080", "--nickname", "Bob"]
depends_on:
- peer1
networks:
- p2p-network
stdin_open: true
tty: true
# Third peer (optional) - connects to first peer
peer3:
build: .
container_name: p2p-chat-peer3
environment:
- RUST_LOG=info
command: ["--connect", "peer1:8080", "--nickname", "Charlie"]
depends_on:
- peer1
networks:
- p2p-network
stdin_open: true
tty: true
profiles:
- multi
networks:
p2p-network:
driver: bridge