mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:04:02 +00:00
Changed the dockerfile to use the official Docker php image and installed the pcov extension instead of xdebug for code coverage. Also updated the docker-compose file to make the main 'test' service not start up before all the DB containers are running ok.
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
version: '2.4'
|
|
services:
|
|
test:
|
|
build:
|
|
context: .
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- .:/var/www/html:delegated
|
|
environment:
|
|
DOCKER: 1
|
|
DB_PASSWORD: password
|
|
DB_USERNAME: root
|
|
DB_DATABASE: main
|
|
TENANCY_TEST_REDIS_HOST: redis
|
|
TENANCY_TEST_MYSQL_HOST: mysql
|
|
TENANCY_TEST_PGSQL_HOST: postgres
|
|
stdin_open: true
|
|
tty: true
|
|
mysql:
|
|
image: mysql:5.7
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: main
|
|
MYSQL_USER: user # redundant
|
|
MYSQL_PASSWORD: password
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
|
timeout: 10s
|
|
retries: 10
|
|
mysql2:
|
|
image: mysql:5.7
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: main
|
|
MYSQL_USER: user # redundant
|
|
MYSQL_PASSWORD: password
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
|
timeout: 10s
|
|
retries: 10
|
|
postgres:
|
|
image: postgres:11
|
|
environment:
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_USER: root # superuser name
|
|
POSTGRES_DB: main
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
redis:
|
|
image: redis:alpine
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 30
|