-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
70 lines (68 loc) · 1.82 KB
/
compose.yml
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
services:
seed:
build:
context: ./src/SqlClient.ConsoleApp
tty: true
container_name: seed
working_dir: /app
env_file:
- .env
environment:
ConnectionString: "Server=tcp:db,1433;Initial Catalog=demo;UID=sa;Password=${MSSQL_SA_PASSWORD};TrustServerCertificate=true;Connection Timeout=3;"
# keep the container alive for debugging
DEBUG: "${DEBUG:-}"
volumes:
- $PWD/SQL/dw-seed.sql:/seed.sql
entrypoint:
- /bin/sh
- -c
- |
./SqlClient.ConsoleApp /seed.sql
if [ -n "$DEBUG" ];then tail -f /dev/null; fi
depends_on:
sqlpackage:
condition: service_completed_successfully
required: true
sqlpackage:
build:
context: ./docker/sqlpackage
tty: true
container_name: sqlpackage
working_dir: /app
env_file:
- .env
environment:
DACFX_TELEMETRY_OPTOUT: true
SourceFile: "bin/Debug/DbProject.dacpac"
TargetConnectionString: "Server=tcp:db,1433;Initial Catalog=demo;UID=sa;Password=${MSSQL_SA_PASSWORD};TrustServerCertificate=true;Connection Timeout=3;"
volumes:
- $PWD/DbProject:/app:rw
- $PWD/scripts:/scripts
entrypoint:
- /bin/bash
- -c
- |
/scripts/deploy.sh
depends_on:
db:
condition: service_healthy
required: true
# https://hub.docker.com/r/microsoft/mssql-server
db:
image: mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04
container_name: db
hostname: db
env_file:
- .env
environment:
ACCEPT_EULA: "Y"
ports:
- "1433:1433"
healthcheck:
test:
- CMD-SHELL
- /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -Q "SELECT getdate()" -b
timeout: 3s
interval: 10s
retries: 10
start_period: 10s