YAML · 2744 bytes Raw Blame History
1 version: '3.8'
2
3 services:
4 coordinator:
5 build:
6 context: ../../zephyrfs-coordinator
7 dockerfile: Dockerfile
8 container_name: zephyrfs-coordinator
9 ports:
10 - "9090:9090"
11 volumes:
12 - coordinator_data:/var/lib/zephyrfs
13 environment:
14 - LOG_LEVEL=info
15 - LISTEN_PORT=9090
16 - DATA_DIR=/var/lib/zephyrfs
17 networks:
18 - zephyrfs
19 healthcheck:
20 test: ["CMD", "./coordinator", "--health-check"]
21 interval: 30s
22 timeout: 10s
23 retries: 3
24 start_period: 40s
25
26 node1:
27 build:
28 context: ../../zephyrfs-node
29 dockerfile: Dockerfile
30 container_name: zephyrfs-node1
31 ports:
32 - "4001:4001"
33 - "8081:8080"
34 volumes:
35 - node1_data:/var/lib/zephyrfs
36 environment:
37 - LOG_LEVEL=info
38 - P2P_PORT=4001
39 - API_PORT=8080
40 - COORDINATOR_URL=http://coordinator:9090
41 - NODE_ID=node1
42 - STORAGE_QUOTA=10GB
43 networks:
44 - zephyrfs
45 depends_on:
46 coordinator:
47 condition: service_healthy
48 healthcheck:
49 test: ["CMD", "zephyrfs-node", "--health-check"]
50 interval: 30s
51 timeout: 10s
52 retries: 3
53 start_period: 40s
54
55 node2:
56 build:
57 context: ../../zephyrfs-node
58 dockerfile: Dockerfile
59 container_name: zephyrfs-node2
60 ports:
61 - "4002:4001"
62 - "8082:8080"
63 volumes:
64 - node2_data:/var/lib/zephyrfs
65 environment:
66 - LOG_LEVEL=info
67 - P2P_PORT=4001
68 - API_PORT=8080
69 - COORDINATOR_URL=http://coordinator:9090
70 - NODE_ID=node2
71 - STORAGE_QUOTA=10GB
72 networks:
73 - zephyrfs
74 depends_on:
75 coordinator:
76 condition: service_healthy
77 healthcheck:
78 test: ["CMD", "zephyrfs-node", "--health-check"]
79 interval: 30s
80 timeout: 10s
81 retries: 3
82 start_period: 40s
83
84 node3:
85 build:
86 context: ../../zephyrfs-node
87 dockerfile: Dockerfile
88 container_name: zephyrfs-node3
89 ports:
90 - "4003:4001"
91 - "8083:8080"
92 volumes:
93 - node3_data:/var/lib/zephyrfs
94 environment:
95 - LOG_LEVEL=info
96 - P2P_PORT=4001
97 - API_PORT=8080
98 - COORDINATOR_URL=http://coordinator:9090
99 - NODE_ID=node3
100 - STORAGE_QUOTA=10GB
101 networks:
102 - zephyrfs
103 depends_on:
104 coordinator:
105 condition: service_healthy
106 healthcheck:
107 test: ["CMD", "zephyrfs-node", "--health-check"]
108 interval: 30s
109 timeout: 10s
110 retries: 3
111 start_period: 40s
112
113 networks:
114 zephyrfs:
115 driver: bridge
116 ipam:
117 config:
118 - subnet: 172.20.0.0/16
119
120 volumes:
121 coordinator_data:
122 driver: local
123 node1_data:
124 driver: local
125 node2_data:
126 driver: local
127 node3_data:
128 driver: local