mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:54:03 +00:00
* Initial implementation (lukinovec) * Make sure DatabaseCacheBootstrapper runs after DatabaseTenancyBootstrapper, misc wip changes * Fix withTenantDatabases() * Add failing test (GlobalCacheTest) * Configure globalCache's DB stores to use central connection instead of default connection every time it's reinstantiated * Make GlobalCache facade not cached. Even though it wasn't causing issues in our existing tests, it likely was flaky, and making it not $cached makes it now consistent with global_cache() - always getting a new CacheManager from the globalCache container binding * Add database connection assertions in GlobalCacheTest * Run all cached resolver/global cache tests with DatabaseCacheBootstrapper * Reset adjustCacheManagerUsing in revert() and TestCase * Reset static $stores property * Finalize GlobalCache-related changes * tests: remove pointless cache TTLs * Refactor DatabaseCacheBootstrapper * Refactor tests Co-authored-by: lukinovec <lukinovec@gmail.com>
109 lines
3.4 KiB
YAML
109 lines
3.4 KiB
YAML
services:
|
|
test:
|
|
build:
|
|
context: .
|
|
args:
|
|
XDEBUG_ENABLED: ${XDEBUG_ENABLED:-false}
|
|
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:
|
|
- .:${PROJECT_PATH:-$PWD}:cached
|
|
working_dir: ${PROJECT_PATH:-$PWD}
|
|
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
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
stdin_open: true
|
|
tty: true
|
|
mysql:
|
|
image: mysql:8
|
|
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:8
|
|
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:2022-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 2 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
|