-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.federation.yml
More file actions
102 lines (98 loc) · 2.61 KB
/
Copy pathdocker-compose.federation.yml
File metadata and controls
102 lines (98 loc) · 2.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
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
# Two-node federation dev stack (LAN peer sync via Compose DNS).
#
# Usage:
# docker compose -f docker-compose.federation.yml up --build -d
# ./scripts/federation_e2e.sh
#
# Peer A: http://localhost:8001
# Peer B: http://localhost:8002
services:
ohm-peer-a:
build:
context: .
dockerfile: Dockerfile
container_name: ohm-peer-a
ports:
- "8001:8001"
env_file:
- .env
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- DEBUG=${DEBUG:-False}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- STORAGE_PROVIDER=${STORAGE_PROVIDER:-local}
- LOCAL_STORAGE_PATH=${LOCAL_STORAGE_PATH:-storage}
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Peer A
- OHM_FEDERATION_NODE_ROLE=peer
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-b:8001
- OHM_FEDERATION_MDNS_ENABLED=false
- OHM_FEDERATION_SYNC_INTERVAL_SEC=30
volumes:
- ohm-storage-a:/app/storage
- ohm-logs-a:/app/logs
- ./test-data:/app/test-data:ro
networks:
- ohm-federation
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
ohm-peer-b:
build:
context: .
dockerfile: Dockerfile
container_name: ohm-peer-b
ports:
- "8002:8001"
env_file:
- .env
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- DEBUG=${DEBUG:-False}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- STORAGE_PROVIDER=${STORAGE_PROVIDER:-local}
- LOCAL_STORAGE_PATH=${LOCAL_STORAGE_PATH:-storage}
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Peer B
- OHM_FEDERATION_NODE_ROLE=peer
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-a:8001
- OHM_FEDERATION_MDNS_ENABLED=false
- OHM_FEDERATION_SYNC_INTERVAL_SEC=30
volumes:
- ohm-storage-b:/app/storage
- ohm-logs-b:/app/logs
- ./test-data:/app/test-data:ro
depends_on:
ohm-peer-a:
condition: service_healthy
networks:
- ohm-federation
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
networks:
ohm-federation:
driver: bridge
volumes:
ohm-storage-a:
driver: local
ohm-storage-b:
driver: local
ohm-logs-a:
driver: local
ohm-logs-b:
driver: local