-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.chaos-test-sqlserver.yml
More file actions
95 lines (91 loc) · 2.46 KB
/
Copy pathdocker-compose.chaos-test-sqlserver.yml
File metadata and controls
95 lines (91 loc) · 2.46 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
services:
# PostgreSQL source database
postgres:
image: postgres:15-alpine
container_name: cdc_postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test.123
POSTGRES_INITDB_ARGS: "--encoding=UTF8"
restart: always
ports:
- "5432:5432"
volumes:
- ./examples/scripts/init_postgres.sql:/docker-entrypoint-initdb.d/init_postgres.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
command: >
postgres
-c wal_level=logical
-c max_replication_slots=10
-c max_wal_senders=10
-c max_connections=500
networks:
- chaos_test_network
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: cdc_sqlserver
restart: always
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Test.123!"
MSSQL_PID: "Developer"
ports:
- "1433:1433"
volumes:
- ./examples/scripts/init_sqlserver.sql:/init/init_sqlserver.sql:ro
- ./tests/chaos/scenarios/verify_sqlserver:/verify:ro
healthcheck:
test: ["CMD-SHELL", "(/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \"$${SA_PASSWORD}\" -C -Q 'SELECT 1' -b || /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$${SA_PASSWORD}\" -Q 'SELECT 1' -b) 2>/dev/null"]
interval: 15s
timeout: 10s
retries: 15
start_period: 40s
networks:
- chaos_test_network
cdc_app:
build:
context: .
dockerfile: Dockerfile
args:
DEST_FEATURES: sqlserver,metrics
container_name: cdc_application
depends_on:
postgres:
condition: service_healthy
sqlserver:
condition: service_healthy
env_file:
- ./env/.env.sqlserver
environment:
RUST_LOG: info
RUST_BACKTRACE: 1
CDC_LAST_LSN_FILE: /app/data/pg2any_last_lsn.metadata
CDC_TRANSACTION_FILE_BASE_PATH: /app/data
CDC_STREAMING: "false"
ports:
- "18083:8080"
restart: unless-stopped
stop_grace_period: 120s
stop_signal: SIGTERM
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 30s
volumes:
- cdc_data:/app/data
networks:
- chaos_test_network
volumes:
cdc_data:
name: chaos_test_cdc_data
networks:
chaos_test_network:
driver: bridge
name: chaos_test_network