companion/@tooling/e2e/docker-compose.e2e.yml
Claude Code 5676f1fee3 chore(e2e): 🔧 Update TypeScript config and Docker Compose for e2e testing environments
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-08 21:29:50 -07:00

91 lines
2.4 KiB
YAML

# E2E test stack for @companion
#
# Starts postgres + redis + companion-api + companion-web (nginx), then runs
# Playwright headless against the full stack.
#
# Usage (from monorepo root):
# docker compose -f ./@tooling/e2e/docker-compose.e2e.yml up --build \
# --abort-on-container-exit --exit-code-from e2e-tests
#
# Or via the run script:
# ./run e2e:docker
services:
e2e-postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: companion
POSTGRES_PASSWORD: companion
POSTGRES_DB: companion_test
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U companion -d companion_test']
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
e2e-redis:
image: redis:7-alpine
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
companion-api:
build:
context: ../..
dockerfile: "./@tooling/e2e/Dockerfile.api.e2e"
environment:
NODE_ENV: test
API_PORT: '3850'
DATABASE_URL: "postgresql://companion:companion@e2e-postgres:5432/companion_test"
REDIS_URL: "redis://e2e-redis:6379"
CHAT_MODEL: stub
VAPID_PUBLIC_KEY: "BDummyPublicKeyForE2ETestsOnlyNotRealVapidKey00000000000000000000000000000000="
VAPID_PRIVATE_KEY: "DummyPrivateKeyForE2ETestsOnlyNotReal000="
VAPID_SUBJECT: "mailto:test@example.com"
PUSH_FIRE_TOKEN: "e2e-test-token"
depends_on:
e2e-postgres:
condition: service_healthy
e2e-redis:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3850/health']
interval: 5s
timeout: 5s
retries: 12
start_period: 15s
companion-web:
build:
context: ../..
dockerfile: "./@tooling/e2e/Dockerfile.web.e2e"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:5850/']
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
e2e-tests:
build:
context: ../..
dockerfile: "./@tooling/e2e/Dockerfile.e2e"
depends_on:
companion-api:
condition: service_healthy
companion-web:
condition: service_healthy
environment:
CI: 'true'
PLAYWRIGHT_BASE_URL: 'http://companion-web:5850'
volumes:
- ../../test-results:/app/test-results
- ../../playwright-report:/app/playwright-report
networks:
default:
name: companion-e2e-network