-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
200 lines (187 loc) · 4.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
200 lines (187 loc) · 4.68 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
services:
postgres:
image: postgres:16-alpine
container_name: medmarket-postgres
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: medmarket
POSTGRES_PASSWORD: medmarket_secret
POSTGRES_DB: medmarket_db
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- medmarket-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U medmarket -d medmarket_db"]
interval: 5s
timeout: 5s
retries: 5
ipfs:
image: ipfs/go-ipfs:v0.22.0
container_name: medmarket-ipfs
restart: unless-stopped
ports:
- "4001:4001" # Swarm / P2P
- "5001:5001" # API
- "8080:8080" # Gateway
volumes:
- ipfs_data:/data/ipfs
networks:
- medmarket-network
hardhat-node:
build:
context: ./blockchain
dockerfile: Dockerfile
container_name: medmarket-hardhat
restart: unless-stopped
ports:
- "8545:8545"
networks:
- medmarket-network
contract-deployer:
build:
context: ./blockchain
dockerfile: Dockerfile
container_name: medmarket-contract-deployer
restart: "no"
environment:
HARDHAT_RPC_URL: http://hardhat-node:8545
PUBLISHER_PRIVATE_KEY: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
depends_on:
hardhat-node:
condition: service_started
command: >
sh -c "sleep 4 &&
npx hardhat run scripts/deploy-integration.cjs --network localhost"
networks:
- medmarket-network
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: medmarket-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://medmarket:medmarket_secret@postgres:5432/medmarket_db
IPFS_API_URL: http://ipfs:5001
HARDHAT_RPC_URL: http://hardhat-node:8545
DFLM_TOKEN_ADDR: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
ESCROW_MANAGER_ADDR: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
MODEL_LICENSE_ADDR: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
postgres:
condition: service_healthy
ipfs:
condition: service_started
hardhat-node:
condition: service_started
contract-deployer:
condition: service_completed_successfully
networks:
- medmarket-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: medmarket-frontend
restart: unless-stopped
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:8000
VITE_HARDHAT_RPC_URL: http://localhost:8545
depends_on:
- backend
- hardhat-node
networks:
- medmarket-network
fl-server:
build:
context: ./ml_core
dockerfile: Dockerfile
container_name: medmarket-fl-server
restart: unless-stopped
profiles: ["ml"]
ports:
- "5000:5000"
command: ["tail", "-f", "/dev/null"]
networks:
- medmarket-network
volumes:
- ./ml_core:/app
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
fl-client-1:
build:
context: ./ml_core
dockerfile: Dockerfile
container_name: medmarket-fl-client-1
restart: unless-stopped
profiles: ["ml"]
command: ["tail", "-f", "/dev/null"]
depends_on:
- fl-server
networks:
- medmarket-network
volumes:
- ./ml_core:/app
# NOTICE: No 'deploy' block here anymore! It will be forced to use CPU.
fl-client-2:
build:
context: ./ml_core
dockerfile: Dockerfile
container_name: medmarket-fl-client-2
restart: unless-stopped
profiles: ["ml"]
command: ["tail", "-f", "/dev/null"]
depends_on:
- fl-server
networks:
- medmarket-network
volumes:
- ./ml_core:/app
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
fl-client-3:
build:
context: ./ml_core
dockerfile: Dockerfile
container_name: medmarket-fl-client-3
restart: unless-stopped
profiles: ["ml"]
command: ["tail", "-f", "/dev/null"]
depends_on:
- fl-server
networks:
- medmarket-network
volumes:
- ./ml_core:/app
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
postgres_data:
ipfs_data:
networks:
medmarket-network:
driver: bridge