-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
154 lines (146 loc) · 3.5 KB
/
docker-compose.yml
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
version: "3.8"
services:
db-mcp-server:
image: freepeak/db-mcp-server:latest
ports:
- "9092:9092"
volumes:
- ./config.json:/app/config.json
- ./wait-for-it.sh:/app/wait-for-it.sh
command:
[
"/bin/sh",
"-c",
"chmod +x /app/wait-for-it.sh && /app/wait-for-it.sh mysql1 3306 30 && /app/wait-for-it.sh mysql2 3306 30 && /app/wait-for-it.sh postgres1 5432 30 && /app/wait-for-it.sh postgres3 5432 30 && /app/server -t sse -c /app/config.json",
]
depends_on:
mysql1:
condition: service_healthy
mysql2:
condition: service_healthy
postgres1:
condition: service_healthy
postgres3:
condition: service_healthy
networks:
- db-network
mysql1:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: db1
MYSQL_USER: user1
MYSQL_PASSWORD: password1
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- "13306:3306"
volumes:
- mysql1_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-u",
"root",
"-ppassword",
]
interval: 5s
timeout: 5s
retries: 10
networks:
- db-network
mysql2:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: db2
MYSQL_USER: user2
MYSQL_PASSWORD: password2
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- "13307:3306"
volumes:
- mysql2_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-u",
"root",
"-ppassword",
]
interval: 5s
timeout: 5s
retries: 10
networks:
- db-network
postgres1:
image: postgres:15
environment:
POSTGRES_USER: user1
POSTGRES_PASSWORD: password1
POSTGRES_DB: db1
ports:
- "15432:5432"
volumes:
- postgres1_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user1 -d db1"]
interval: 5s
timeout: 5s
retries: 10
networks:
- db-network
postgres2:
image: postgres:17
environment:
POSTGRES_USER: user2
POSTGRES_PASSWORD: password2
POSTGRES_DB: db2
ports:
- "15433:5432"
volumes:
- postgres2_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user2 -d db2"]
interval: 5s
timeout: 5s
retries: 10
networks:
- db-network
postgres3:
image: postgres:16.3-alpine
environment:
POSTGRES_USER: screener
POSTGRES_PASSWORD: screenerpass
POSTGRES_DB: screenerdb
ports:
- "15434:5432"
volumes:
- postgres3_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U screener -d screenerdb"]
interval: 5s
timeout: 5s
retries: 10
networks:
- db-network
networks:
db-network:
driver: bridge
volumes:
mysql1_data:
mysql2_data:
postgres1_data:
postgres2_data:
postgres3_data: