-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathcompose.yml
More file actions
109 lines (104 loc) · 3.83 KB
/
Copy pathcompose.yml
File metadata and controls
109 lines (104 loc) · 3.83 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
# Local-runnable data warehouses for dbt_artifacts integration tests.
#
# Used by both local development (`scripts/ci/compose-up.sh`) and GitHub Actions.
# The contract: every service has a healthcheck, so `docker compose up --wait`
# returns only when the stack is actually ready to accept connections.
#
# Ports reserved on the host (deliberately non-standard to avoid clashing
# with anything a developer is already running — local Postgres on 5432,
# whatever's on 8080, etc.). Containers internally still listen on stock
# ports; only the host-side mapping is shifted. profiles.yml hardcodes
# these shifted values so dbt connects to the test stack, not your laptop's
# default services.
# 55432 postgres (container: 5432)
# 58080 trino (container: 8080)
# 51433 sqlserver (container: 1433)
#
# Host-side prerequisites (NOT installed by this file):
# - SQL Server: the Microsoft ODBC Driver 18 must be installed on the host
# because dbt-sqlserver runs on the host and connects into the container.
# macOS: brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
# brew install msodbcsql18 mssql-tools18
# Linux: sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
#
# Image tags are pinned to specific versions, not floating `:latest`, to
# guarantee local ↔ CI parity. Update tags deliberately, in a single PR.
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "55432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
trino:
image: trinodb/trino:476
ports:
- "58080:8080"
environment:
DBT_FILE_FORMAT: csv
volumes:
- ./integration_test_project/.trino-config:/etc/trino
healthcheck:
test:
- "CMD-SHELL"
- "curl -fsS http://localhost:8080/v1/info | grep -q '\"starting\":false'"
interval: 5s
timeout: 5s
retries: 30
start_period: 30s
sqlserver:
image: mcr.microsoft.com/mssql/server:2025-latest
user: root
platform: linux/amd64
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "123Administrator"
MSSQL_PID: "DeveloperStandard"
DOCKER_DEFAULT_PLATFORM: "linux/amd64"
ports:
- "51433:1433"
volumes:
- sqlserver_data:/var/opt/mssql
- ./init-scripts/sqlserver:/setup
restart: always
healthcheck:
test:
- "CMD-SHELL"
- "/opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1,1433 -U sa -P ${MSSQL_SA_PASSWORD:-123Administrator} -No -Q 'SELECT 1' || exit 1"
interval: 10s
retries: 10
start_period: 30s
timeout: 10s
sqlserver-configurator:
image: mcr.microsoft.com/mssql/server:2025-latest
platform: linux/amd64
volumes:
- ./init-scripts/sqlserver:/docker-entrypoint-initdb.d
depends_on:
sqlserver:
condition: service_healthy
command: >
bash -c '
/opt/mssql-tools18/bin/sqlcmd -S sqlserver -U sa -P ${MSSQL_SA_PASSWORD:-123Administrator} -No -d master -i docker-entrypoint-initdb.d/init.sql
&& echo "SQL Server bootstrap complete.";
'
# This is a run-to-completion init container: it runs init.sql, prints
# the success message, and exits. Crucially, it is NOT compatible with
# `docker compose up --wait` — `--wait` treats "not running" as a
# failure regardless of exit code, so a container that exits cleanly
# still makes `--wait` return non-zero. `scripts/ci/compose-up.sh`
# handles that by bringing init containers up separately and using
# `docker compose wait` (different command) to block on their exit.
volumes:
postgres_data:
sqlserver_data: