2026-04-08 21:29:50 -07:00
|
|
|
# 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
|
|
|
|
|
|
2026-06-10 03:15:37 -07:00
|
|
|
# LAN registry hosts (forge.black.lan, npm.black.lan → 10.0.0.11)
|
2026-04-08 21:52:24 -07:00
|
|
|
x-lan-hosts: &lan-hosts
|
|
|
|
|
extra_hosts:
|
2026-06-10 03:15:37 -07:00
|
|
|
- "forge.black.lan:10.0.0.11"
|
|
|
|
|
- "npm.black.lan:10.0.0.11"
|
2026-04-08 21:52:24 -07:00
|
|
|
|
|
|
|
|
x-lan-build: &lan-build
|
|
|
|
|
args:
|
|
|
|
|
- BUILDKIT_SANDBOX_HOSTNAME=builder
|
|
|
|
|
extra_hosts:
|
2026-06-10 03:15:37 -07:00
|
|
|
- "forge.black.lan:10.0.0.11"
|
|
|
|
|
- "npm.black.lan:10.0.0.11"
|
2026-04-08 21:52:24 -07:00
|
|
|
|
2026-04-08 21:29:50 -07:00
|
|
|
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:
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-hosts
|
2026-04-08 21:29:50 -07:00
|
|
|
build:
|
|
|
|
|
context: ../..
|
|
|
|
|
dockerfile: "./@tooling/e2e/Dockerfile.api.e2e"
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-build
|
2026-04-08 21:29:50 -07:00
|
|
|
environment:
|
|
|
|
|
NODE_ENV: test
|
|
|
|
|
API_PORT: '3850'
|
2026-04-08 22:36:58 -07:00
|
|
|
DATABASE_HOST: e2e-postgres
|
|
|
|
|
DATABASE_PORT: '5432'
|
|
|
|
|
DATABASE_USER: companion
|
|
|
|
|
DATABASE_PASSWORD: companion
|
|
|
|
|
DATABASE_NAME: companion_test
|
|
|
|
|
DATABASE_SYNCHRONIZE: 'true'
|
2026-04-08 21:29:50 -07:00
|
|
|
REDIS_URL: "redis://e2e-redis:6379"
|
|
|
|
|
CHAT_MODEL: stub
|
2026-04-08 22:36:58 -07:00
|
|
|
VAPID_PUBLIC_KEY: "BMrVU3JFoq8bX0YEwUTsHvoIGmzWBluhT98IZXqMQ1vHdFtD1SQlKUJx5DeftHFhYuhfRw-4DOL5wfcQ8fXqDTo"
|
|
|
|
|
VAPID_PRIVATE_KEY: "H_Rllr7WXAgOajWjVBFY7yIxVwR2HiDlz0BeNJfbYKs"
|
2026-04-08 21:29:50 -07:00
|
|
|
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:
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-hosts
|
2026-04-08 21:29:50 -07:00
|
|
|
build:
|
|
|
|
|
context: ../..
|
|
|
|
|
dockerfile: "./@tooling/e2e/Dockerfile.web.e2e"
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-build
|
2026-04-08 22:36:58 -07:00
|
|
|
depends_on:
|
|
|
|
|
companion-api:
|
|
|
|
|
condition: service_healthy
|
2026-04-08 21:29:50 -07:00
|
|
|
healthcheck:
|
|
|
|
|
test: ['CMD', 'curl', '-f', 'http://localhost:5850/']
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 10
|
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
|
|
e2e-tests:
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-hosts
|
2026-04-08 21:29:50 -07:00
|
|
|
build:
|
|
|
|
|
context: ../..
|
|
|
|
|
dockerfile: "./@tooling/e2e/Dockerfile.e2e"
|
2026-04-08 21:52:24 -07:00
|
|
|
<<: *lan-build
|
2026-04-08 21:29:50 -07:00
|
|
|
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
|