knex/scripts/docker-compose.yml
Mikael Lepistö 8a9a648ae2
Docker based test dbs (#3157)
* Fixed some of the tests failing with various dialect combinations

* Setup all test databases to run in docker

* Fixed test suite and updated travis to use docker

* Fixed some tests in master and disabled oracle tests while setting everything else to work again

* Changed docker to use latest postgresql alpine image

* Re-enabled all oracledb tests

* Install oracle client libs to oracle server and copy them to travis to make node oracledb package to work

* Disabled random failing oracle tests and added test to show that oracle update in transaction does not seem to work ACID

* Update package.json

* Update package.json

* Fixed linting issues

* Fixed waiting for postgres to use the same DB image that database is using.

* Removed installing oracledb driver in travis if not needed .travis.yml

* Cleaned up package.json more

* Created static name for oracledb container to allow copying files out of it on different docker versions

* Removed webpack from deps
2019-05-13 12:21:36 +03:00

98 lines
2.4 KiB
YAML

version: '3'
services:
mssql:
image: microsoft/mssql-server-linux:2017-latest
ports:
- '21433:1433'
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=S0meVeryHardPassword
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P 'S0meVeryHardPassword' -Q 'select 1'
initmssqlknexdb:
image: microsoft/mssql-server-linux:2017-latest
links:
- mssql
depends_on:
- mssql
entrypoint:
- bash
- -c
- 'until /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P S0meVeryHardPassword -d master -Q "CREATE DATABASE knex_test"; do sleep 5; done'
mysql:
image: mysql
command: --default-authentication-plugin=mysql_native_password
ports:
- '23306:3306'
environment:
- MYSQL_ROOT_PASSWORD=testrootpassword
- MYSQL_DATABASE=knex_test
- MYSQL_USER=testuser
- MYSQL_PASSWORD=testpassword
healthcheck:
test:
[
'CMD',
'/usr/bin/mysql',
'-hlocalhost',
'-utestuser',
'-ptestpassword',
'-e',
'SELECT 1',
]
interval: 30s
timeout: 5s
retries: 3
restart: always
waitmysql:
image: mysql
links:
- mysql
depends_on:
- mysql
entrypoint:
- bash
- -c
- 'until /usr/bin/mysql -hmysql -utestuser -ptestpassword -e "SELECT 1"; do sleep 5; done'
postgres:
image: postgres:alpine
ports:
- '25432:5432'
environment:
- POSTGRES_USER=testuser
- POSTGRES_PASSWORD=knextest
- POSTGRES_DB=knex_test
waitpostgres:
image: postgres:alpine
links:
- postgres
depends_on:
- postgres
entrypoint:
- bash
- -c
- 'until /usr/local/bin/psql postgres://testuser:knextest@postgres/knex_test -c "SELECT 1"; do sleep 5; done'
oracledbxe:
image: quillbuilduser/oracle-18-xe
container_name: oracledbxe_container
ports:
- '21521:1521'
environment:
- ORACLE_ALLOW_REMOTE=true
waitoracledbxe:
image: quillbuilduser/oracle-18-xe
links:
- oracledbxe
depends_on:
- oracledbxe
environment:
- ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
entrypoint:
- bash
- -c
- 'until /opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s sys/Oracle18@oracledbxe/XE as sysdba <<< "SELECT 13376411 FROM DUAL; exit;" | grep "13376411"; do echo "Could not connect to oracle... sleep for a while"; sleep 5; done'