Skip to content

Commit 7259271

Browse files
author
Sylvestre Gug
committed
added mysql to docker-compose
1 parent febab0b commit 7259271

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.env.test

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
NODE_ENV=test
2+
MYSQL_TEST_CREDENTIALS={"user":"root","host":"mysql","port":3306,"database":"mysql","ssl":"disabled"}
23
MSSQL_CREDENTIALS:Server=mssql,1433;Database=master;User Id=sa;Password=Pass@word;trustServerCertificate=true;
34
MSSQL_CREDENTIALS_READ_ONLY:Server=mssql,1433;Database=master;User Id=reader;Password=re@derP@ssw0rd;trustServerCertificate=true;

docker-compose.local.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ version: "3.7"
33
services:
44
mssql:
55
image: mcr.microsoft.com/azure-sql-edge
6-
expose:
7-
- "1433"
6+
ports:
7+
- "1433:1433"

docker-compose.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ services:
55
build: .
66
depends_on:
77
- mssql
8+
- mysql
89
env_file:
910
- .env.test
1011
networks:
1112
- db_proxy_test
12-
command: sh -c "set -o pipefail && wait-on -d 10000 -t 30000 tcp:mssql:1433 && node ./data/seed.mssql.js && TZ=UTC NODE_ENV=TEST node_modules/.bin/mocha"
13+
command: sh -c "set -o pipefail && wait-on -d 15000 -t 30000 tcp:mysql:3306 tcp:mssql:1433 && node ./data/seed.mssql.js && TZ=UTC NODE_ENV=TEST node_modules/.bin/mocha"
1314

1415
mssql:
1516
image: mcr.microsoft.com/mssql/server:2019-latest
@@ -20,8 +21,13 @@ services:
2021
- MSSQL_SLEEP=7
2122
volumes:
2223
- ./data/AdventureWorks2019.bak:/var/opt/mssql/backup/test.bak
23-
ports:
24-
- "1433:1433"
24+
networks:
25+
- db_proxy_test
26+
27+
mysql:
28+
image: mariadb:10.6.4
29+
environment:
30+
- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=yes
2531
networks:
2632
- db_proxy_test
2733

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"test": "mocha",
5252
"test:local": "docker-compose -f docker-compose.yml -f docker-compose.local.yml up --build",
5353
"test:ci": "docker-compose -f docker-compose.yml up --build --exit-code-from test",
54-
"test:db": "docker-compose -f docker-compose.yml -f docker-compose.local.yml up mssql"
54+
"test:db": "docker-compose -f docker-compose.yml -f docker-compose.local.yml up mssql mysql"
5555
},
5656
"author": "Observable",
5757
"license": "ISC",

0 commit comments

Comments
 (0)