Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (63 loc) · 2.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (63 loc) · 2.41 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
# The test databases, see "Running the tests" in doc/guide/contributing.md.
# The host ports are unusual on purpose, so they don't collide with databases
# that may already be installed locally. They stay below 32768, out of the range
# that Linux takes ports for outgoing connections from.
name: objection
services:
postgres:
image: 'postgres:17'
command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0
ports:
- '15432:5432'
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_USER=objection
- POSTGRES_DB=objection_test
healthcheck:
# Connect over TCP, which only works once the initialization is done.
test: pg_isready -h 127.0.0.1 -U objection -d objection_test
interval: 1s
retries: 60
mysql:
image: 'mysql:8.4'
# The mysql driver only supports mysql_native_password, which MySQL 8.4
# disables by default. Enable it and make it the default for new users.
command: --mysql-native-password=ON --authentication-policy=mysql_native_password
ports:
- '13306:3306'
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=objection_test
configs:
- source: mysql-init
target: /docker-entrypoint-initdb.d/init.sql
healthcheck:
# Connect over TCP, which only works once the initialization is done.
test: mysqladmin ping -h 127.0.0.1 -u objection
interval: 1s
retries: 60
mssql:
image: 'mcr.microsoft.com/mssql/server:2022-latest'
# There is no arm64 image of SQL Server.
platform: linux/amd64
# Only started on request, e.g. `pnpm db:up mssql`, as the image is
# large and runs emulated on arm64.
profiles: [mssql]
ports:
- '11433:1433'
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=Objection1!
healthcheck:
# The image can't create a database on its own, so the healthcheck creates
# it once the server accepts connections.
test: /opt/mssql-tools18/bin/sqlcmd -C -S 127.0.0.1 -U sa -P "$$MSSQL_SA_PASSWORD" -Q "IF DB_ID('objection_test') IS NULL CREATE DATABASE objection_test"
interval: 2s
retries: 60
configs:
mysql-init:
# The image can only create users with a password. The tests create
# databases, so the user needs more than access to objection_test.
content: |
CREATE USER objection;
GRANT ALL PRIVILEGES ON *.* TO objection;