-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
82 lines (75 loc) · 3.07 KB
/
docker-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
71
72
73
74
75
76
77
78
79
80
81
82
version: '3.7'
services:
postgres:
image: postgres:10.5
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
logging:
options:
max-size: 10m
max-file: "3"
ports:
- '5432:5432'
volumes:
- ./postgres-10-5/postgres-data:/var/lib/postgresql/data
# copy the sql script to create tables
- ./postgres-10-5/sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
# copy the sql script to fill tables
- ./postgres-10-5/sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql
# copy the sql script to create tidal user and permissions
- ./postgres-10-5/sql/tidal_setup.sql:/docker-entrypoint-initdb.d/tidal_setup.sql
mysql:
image: mysql:8.0
restart: always
environment:
- MYSQL_ROOT_USER=root
- MYSQL_ROOT_PASSWORD=root-secret
- MYSQL_DATABASE=tidal_db
logging:
options:
max-size: 10m
max-file: "3"
ports:
- '3306:3306'
volumes:
- ./mysql-8/mysql-data:/var/lib/mysql-data/data
# copy the sql script to create tables
- ./mysql-8/sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
# # copy the sql script to fill tables
- ./mysql-8/sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql
# - ./mysql-8/sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql
# copy the sql script to create tidal user and permissions
- ./mysql-8/sql/tidal_setup.sql:/docker-entrypoint-initdb.d/tidal_setup.sql
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
environment:
- SA_PASSWORD=Dev12345
- ACCEPT_EULA=Y
ports:
- 1433:1433
volumes:
- ./mssql-2019/sql:/scripts/
command:
- /bin/bash
- -c
- |
# Launch mssql and send to background
/opt/mssql/bin/sqlservr &
# Wait for it to be available
echo "Waiting for MS SQL to be available ⏳"
/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $$SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername"
is_up=$$?
while [ $$is_up -ne 0 ] ; do
echo -e $$(date)
/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $$SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername"
is_up=$$?
sleep 5
done
# Run the SQL scripts in order
/opt/mssql-tools/bin/sqlcmd -U SA -P $$SA_PASSWORD -l 30 -e -i /scripts/create_tables.sql
/opt/mssql-tools/bin/sqlcmd -U SA -P $$SA_PASSWORD -l 30 -e -i /scripts/fill_tables.sql
/opt/mssql-tools/bin/sqlcmd -U SA -P $$SA_PASSWORD -l 30 -e -i /scripts/tidal_setup.sql
# So that the container doesn't shut down, sleep this thread
sleep infinity