Skip to content

Commit c907a1f

Browse files
Peet Whittakerpeetw
authored andcommitted
Add docker compose file to initialize databases for local testing
1 parent 1d71021 commit c907a1f

File tree

10 files changed

+52
-57
lines changed

10 files changed

+52
-57
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MSSQL_SA_PASSWORD=Password123
2+
MYSQL_ROOT_PASSWORD=Password123
3+
POSTGRES_PASSWORD=Password123

Tests.NHibernate.Spatial.MsSql2008/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

Tests.NHibernate.Spatial.MsSql2012/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

Tests.NHibernate.Spatial.MsSql2012/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"ConnectionStrings": {
33
"_comment1": "NOTE: Must specify SQL Server 2012 for the Type System Version attribute (see issue #72)",
44
"_comment2": "NOTE: TrustServerCertificate=True required after updating from System.Data.Sql to Microsoft.Data.Sql as Encrypt is now set to true by default; see: https://stackoverflow.com/a/17658821/3628232",
5-
"MsSql2012": "Server=(local)\\MSSQLSERVER2012;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012;TrustServerCertificate=True"
5+
"MsSql2012": "Server=localhost,11433;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012;TrustServerCertificate=True"
66
}
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"ConnectionStrings": {
3-
"MySQL57": "Server=localhost;Port=3307;Database=nhsp_test;User Id=nhsp_test;Password=nhsp_test;"
3+
"MySQL57": "Server=localhost;Port=13306;Database=nhsp_test;User Id=nhsp_test;Password=nhsp_test;"
44
}
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"ConnectionStrings": {
3-
"PostGis20": "Server=localhost;Port=5432;Database=nhsp_test;User Id=nhsp_test;Password=nhsp_test;"
3+
"PostGis20": "Server=localhost;Port=15432;Database=nhsp_test;User Id=nhsp_test;Password=nhsp_test;"
44
}
55
}

docker-compose.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: "3.8"
2+
3+
services:
4+
sqlserver2017:
5+
image: mcr.microsoft.com/mssql/server:2017-latest
6+
environment:
7+
ACCEPT_EULA: Y
8+
MSSQL_PID: Developer
9+
MSSQL_SA_PASSWORD: # See .env file
10+
ports:
11+
- 11433:1433
12+
healthcheck:
13+
test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $${MSSQL_SA_PASSWORD} -Q 'SELECT 1' || exit 1
14+
interval: 10s
15+
retries: 10
16+
start_period: 10s
17+
timeout: 3s
18+
19+
sqlserver2017.init:
20+
image: mcr.microsoft.com/mssql-tools
21+
environment:
22+
MSSQL_SA_PASSWORD: # See .env file
23+
volumes:
24+
- ./Tests.NHibernate.Spatial.MsSql2012/initdb:/docker-entrypoint-initdb.d
25+
depends_on:
26+
sqlserver2017:
27+
condition: service_healthy
28+
command: sh -c "/opt/mssql-tools/bin/sqlcmd -S sqlserver2017 -U sa -P $${MSSQL_SA_PASSWORD} -d master -i docker-entrypoint-initdb.d/nhsp_test.sql"
29+
30+
mysql57:
31+
image: mysql:5.7
32+
environment:
33+
MYSQL_ROOT_PASSWORD: # See .env file
34+
ports:
35+
- 13306:3306
36+
volumes:
37+
- ./Tests.NHibernate.Spatial.MySQL57/initdb:/docker-entrypoint-initdb.d
38+
39+
postgis20:
40+
image: postgis/postgis:12-2.5
41+
environment:
42+
POSTGRES_PASSWORD: # See .env file
43+
ports:
44+
- 15432:5432
45+
volumes:
46+
- ./Tests.NHibernate.Spatial.PostGis20/initdb:/docker-entrypoint-initdb.d

0 commit comments

Comments
 (0)