-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
38 lines (37 loc) · 1.22 KB
/
docker-compose.yaml
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
version: "3.9"
services:
mssql-db:
image: "mcr.microsoft.com/mssql/server:2019-latest"
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Password123.A"
ports:
- "1433:1433"
networks:
- my-network
healthcheck:
test: [ "CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost,1433", "-U", "sa", "-P", "Password123.A", "-Q", "SELECT 1" ]
interval: 1s
retries: 30
mssql-db-setup:
image: "mcr.microsoft.com/mssql/server:2019-latest"
# seems service is ready after entrypoint script exists & then depends_on of liquibase will start new container
entrypoint: [ "/opt/mssql-tools/bin/sqlcmd", "-S", "mssql-db,1433", "-U", "sa", "-P", "Password123.A", "-i", "/db-migration/create-db.sql" ]
volumes:
- ./sql:/db-migration
networks:
- my-network
depends_on:
mssql-db:
condition: service_healthy
liquibase:
image: liquibase/liquibase
command: [ "--url=jdbc:sqlserver://mssql-db:1433;databaseName=ExprDB;username=sa;password=Password123.A", "--changeLogFile=./changelog/changelog.xml", "update" ]
volumes:
- ./sql:/liquibase/changelog
networks:
- my-network
depends_on:
- mssql-db-setup
networks:
my-network: