forked from better-auth/better-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
173 lines (161 loc) · 4.19 KB
/
docker-compose.yml
File metadata and controls
173 lines (161 loc) · 4.19 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
# cspell:ignore isready uuser ppassword
x-postgres-healthcheck: &postgres-healthcheck
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d better_auth"]
interval: 1s
timeout: 5s
retries: 10
x-mysql-healthcheck: &mysql-healthcheck
healthcheck:
# Use 127.0.0.1 (not localhost) to force TCP. localhost resolves to a Unix
# socket on Linux, which can falsely succeed against the temporary init
# server that runs with --skip-networking.
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uuser", "-ppassword"]
interval: 1s
timeout: 5s
retries: 10
# MySQL cold-start (data dir init, system tables, user/db creation) takes
# 10-20s in CI. Without start_period, docker compose --wait fails immediately
# once retries are exhausted — it does NOT wait for --wait-timeout.
start_period: 30s
services:
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 1s
timeout: 5s
retries: 10
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 5s
retries: 10
# drizzle
postgres:
<<: *postgres-healthcheck
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: better_auth
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql
postgres-kysely:
<<: *postgres-healthcheck
image: postgres:latest
container_name: postgres-kysely
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: better_auth
ports:
- "5433:5432"
volumes:
- postgres-kysely_data:/var/lib/postgresql
postgres-kysely2:
<<: *postgres-healthcheck
image: postgres:latest
container_name: postgres-kysely2
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: better_auth
ports:
- "5435:5432"
volumes:
- postgres-kysely2_data:/var/lib/postgresql
postgres-prisma:
<<: *postgres-healthcheck
image: postgres:latest
container_name: postgres-prisma
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: better_auth
ports:
- "5434:5432"
volumes:
- postgres-prisma_data:/var/lib/postgresql
# Drizzle tests
mysql:
<<: *mysql-healthcheck
image: mysql:latest
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: better_auth
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
mysql-kysely:
<<: *mysql-healthcheck
image: mysql:latest
container_name: mysql-kysely
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: better_auth
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3307:3306"
volumes:
- mysql-kysely_data:/var/lib/mysql
mysql-prisma:
<<: *mysql-healthcheck
image: mysql:latest
container_name: mysql-prisma
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: better_auth
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3308:3306"
volumes:
- mysql-prisma_data:/var/lib/mysql
mssql:
image: mcr.microsoft.com/mssql/server:latest
container_name: mssql
environment:
SA_PASSWORD: "Password123!"
ACCEPT_EULA: "Y"
ports:
- "1433:1433"
volumes:
- mssql_data:/var/opt/mssql
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'Password123!' -Q 'SELECT 1' -b -o /dev/null"]
interval: 1s
timeout: 5s
retries: 30
start_period: 5s
volumes:
mongodb_data:
redis_data:
postgres_data:
postgres-kysely_data:
postgres-prisma_data:
mysql_data:
mssql_data:
mysql-kysely_data:
mysql-prisma_data:
postgres-kysely2_data: