1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:34:04 +00:00
tenancy/docker-compose.yml

104 lines
3.2 KiB
YAML

services:
test:
build:
context: .
depends_on:
mysql:
condition: service_healthy
mysql2:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_healthy
mssql:
condition: service_healthy
memcached:
condition: service_healthy
dynamodb:
condition: service_healthy
volumes:
- .:/var/www/html:cached
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
TENANCY_TEST_SQLSRV_HOST: mssql
TENANCY_TEST_SQLSRV_USERNAME: sa
TENANCY_TEST_SQLSRV_PASSWORD: P@ssword
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
tmpfs:
- /var/lib/mysql
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
tmpfs:
- /var/lib/mysql
postgres:
image: postgres:16
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
tmpfs:
- /var/lib/postgresql/data
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=P@ssword # todo reuse env from above
healthcheck: # https://github.com/Microsoft/mssql-docker/issues/133#issuecomment-1995615432
test: timeout 1 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/1433'
interval: 10s
timeout: 10s
retries: 10
redis:
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 20
memcached:
image: memcached:alpine
healthcheck:
test: ["CMD-SHELL", "echo version | nc localhost 11211 | grep -q VERSION"]
interval: 1s
timeout: 3s
retries: 20
dynamodb:
image: amazon/dynamodb-local:latest
healthcheck:
test: ["CMD-SHELL", "cat < /dev/null > /dev/tcp/127.0.0.1/8000"]
interval: 1s
timeout: 3s
retries: 20