compose.test.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Test-only shared services for the compose-first integration harness.
  2. #
  3. # Starts ONE Postgres + ONE Redis shared by every test process. Per-test
  4. # isolation comes from the harness itself (fresh `CREATE DATABASE` per test,
  5. # unique Redis key prefixes per test) — never from per-test containers, and
  6. # never via FLUSHALL/FLUSHDB (nextest runs tests in parallel processes).
  7. #
  8. # Credentials and ports match the harness defaults exactly
  9. # (`D_OAUTH_TEST_POSTGRES_URL` / `D_OAUTH_TEST_REDIS_URL` overrides in
  10. # `tests/common/mod.rs`):
  11. #
  12. # docker compose -f compose.test.yaml up -d
  13. # cargo nextest run -E 'test(migration_users_creates_schema_and_second_run_is_noop)'
  14. # docker compose -f compose.test.yaml down -v
  15. #
  16. # Ports 5433/6380 avoid clashing with a developer's local 5432/6379.
  17. # This file is test-only; the local proof deployment stays in `compose.yaml`.
  18. name: d-oauth-test
  19. services:
  20. test-db:
  21. image: postgres:16-alpine
  22. environment:
  23. POSTGRES_PASSWORD: oauth-test-only
  24. ports:
  25. - "5433:5432"
  26. healthcheck:
  27. test: ["CMD-SHELL", "pg_isready -U postgres"]
  28. interval: 5s
  29. timeout: 3s
  30. retries: 20
  31. test-redis:
  32. image: redis:7-alpine
  33. # Mirrors the server's durability contract: AOF on, eviction off.
  34. command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
  35. ports:
  36. - "6380:6379"
  37. healthcheck:
  38. test: ["CMD", "redis-cli", "ping"]
  39. interval: 5s
  40. timeout: 3s
  41. retries: 20