forked from prisma/prisma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
260 lines (246 loc) · 7.02 KB
/
docker-compose.yml
File metadata and controls
260 lines (246 loc) · 7.02 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: prisma-prisma
# For connection urls to the following instances, see
# https://github.com/prisma/prisma/blob/main/TESTING.md#environment-variables
services:
postgres:
build:
context: ./postgres_ext
args:
POSTGRES_VERSION: 12
restart: unless-stopped
# Uncomment the following line to enable query logging
# Then restart the container.
# command: ['postgres', '-c', 'log_statement=all']
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '5432:5432'
healthcheck:
# specifying user and database is needed to avoid `FATAL: role "root" does not exist`
# spam in the logs
test: ['CMD', 'pg_isready', '-U', 'prisma', '-d', 'tests']
interval: 5s
timeout: 2s
retries: 20
postgres-16:
build:
context: ./postgres_ext
args:
POSTGRES_VERSION: 16
restart: unless-stopped
# Uncomment the following line to enable query logging
# Then restart the container.
# command: ['postgres', '-c', 'log_statement=all']
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '15432:5432'
healthcheck:
# specifying user and database is needed to avoid `FATAL: role "root" does not exist`
# spam in the logs
test: ['CMD', 'pg_isready', '-U', 'prisma', '-d', 'tests']
interval: 5s
timeout: 2s
retries: 20
postgres_isolated:
image: postgres:10
restart: unless-stopped
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '5435:5432'
healthcheck:
test: ['CMD', 'pg_isready']
interval: 5s
timeout: 2s
retries: 20
cockroachdb:
image: prismagraphql/cockroachdb-custom:23.1
restart: unless-stopped
command: start-single-node --insecure
ports:
- '26257:26257'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:8080/health?ready=1']
interval: 5s
timeout: 2s
retries: 20
# Planetscale
# From https://github.com/prisma/prisma-engines/blob/976a00ae3c30ab9507fa742986c9c6f5327ba10f/docker-compose.yml
vitess-8:
image: vitess/vttestserver:mysql80@sha256:22c9945888fd6d5b192072895db91a1c0357f6ed932993d04689c716cf828bb2
restart: unless-stopped
ports:
- 33807:33807
environment:
PORT: '33804' # unused in testing, but required by vttestserver
KEYSPACES: 'unsharded' # unused in testing, but required by vttestserver
NUM_SHARDS: '1' # unused in testing, but required by vttestserver
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '1s'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33807']
interval: 5s
timeout: 2s
retries: 20
mysql:
image: mysql:9.0
command: --lower_case_table_names=1
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '3306:3306'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P3306']
interval: 5s
timeout: 2s
retries: 20
mysql_isolated:
image: mysql:9.0
command: --lower_case_table_names=1
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '3307:3306'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P3306']
interval: 5s
timeout: 2s
retries: 20
mariadb:
image: mariadb:10
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '4306:3306'
healthcheck:
test: ['CMD', '/usr/local/bin/healthcheck.sh', '--connect']
interval: 5s
timeout: 2s
retries: 20
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
restart: unless-stopped
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Pr1sm4_Pr1sm4
ports:
- '1433:1433'
healthcheck:
test: ['CMD', '/opt/mssql-tools18/bin/sqlcmd', '-C', '-Usa', '-PPr1sm4_Pr1sm4', '-Q', 'select 1']
interval: 5s
timeout: 2s
retries: 20
mongodb_migrate:
image: mongo:4
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: tests-migrate
ports:
- '27017:27017'
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongo', 'admin', '--port', '27017', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
start_period: 20s
volumes:
- ./mongodb_migrate_seed:/mongodb_migrate_seed
- ./mongodb_migrate_seed:/docker-entrypoint-initdb.d
# This config is for MongoDB v4
# It's a Replica Set (required for Prisma Client)
mongo:
build:
context: ./mongodb_replica
args:
MONGO_VERSION: 4
environment:
MONGO_REPLICA_HOST: 127.0.0.1
MONGO_REPLICA_PORT: 27018
# Use "mongo" instead of "mongosh" before v5.0
MONGO_COMMAND: 'mongo'
ports:
- '27018:27018'
restart: unless-stopped
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongo', 'admin', '--port', '27018', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
# -> only used for manual testing locally
# This config is for MongoDB v5+
# It's a Replica Set (required for Prisma Client)
mongo6:
build:
context: ./mongodb_replica
args:
MONGO_VERSION: 6
environment:
MONGO_REPLICA_HOST: 127.0.0.1
MONGO_REPLICA_PORT: 27019
# Use "mongo" instead of "mongosh" before v5.0
MONGO_COMMAND: 'mongosh'
ports:
- '27019:27019'
restart: unless-stopped
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongosh', 'admin', '--port', '27019', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
neon_wsproxy:
image: ghcr.io/neondatabase/wsproxy:latest
environment:
APPEND_PORT: 'postgres-16:5432'
ALLOW_ADDR_REGEX: '.*'
LOG_TRAFFIC: 'true'
LOG_CONN_INFO: 'true'
ports:
- '5488:80'
depends_on:
- postgres-16
restart: unless-stopped
healthcheck:
test: ['CMD', 'nc', '-z', '127.0.0.1', '80']
interval: 5s
timeout: 2s
retries: 20
planetscale_proxy:
build: ./planetscale_proxy
environment:
MYSQL_HOST: 'vitess-8' # docker url
MYSQL_PORT: 33807
MYSQL_DATABASE: 'test-0000-00000000'
ports:
- '8085:8085'
depends_on:
- vitess-8
restart: unless-stopped
healthcheck:
test: ['CMD', 'nc', '-z', '127.0.0.1', '8085']
interval: 5s
timeout: 2s
retries: 20