platform-codebase/features/frontend-showcase/e2e/docker-compose.yml

83 lines
2.4 KiB
YAML
Executable file

# E2E Integration Tests - UI Dev Tools / WYSIWYG Content Editor
#
# Self-contained test environment for dev-time content editing testing.
# Tests full stack: Backend API, Frontend overlay, Transformer workflows
#
# Usage:
# # Run tests (automatically tears down on completion)
# docker compose up --build --abort-on-container-exit --exit-code-from e2e-tests
# docker compose down --volumes
#
# # Or use the helper script (recommended)
# ./run-e2e.sh
#
# Services started/stopped automatically:
# - ui-dev-tools-api: Dev API for locale/image operations
# - frontend-showcase: Vite dev server with overlay
# - e2e-tests: Playwright test runner
#
# Cleanup:
# - Containers stopped via --abort-on-container-exit
# - Full teardown (containers, networks, volumes) via 'down --volumes'
services:
# UI Dev Tools Backend API
# Provides /dev/read-locale, /dev/write-locale endpoints
ui-dev-tools-api:
build:
context: ../../../..
dockerfile: codebase/features/ui-dev-tools/backend-api/Dockerfile.e2e
network: host
ports:
- "3016:3016"
environment:
- NODE_ENV=development
- PORT=3016
- FEATURES_PATH=/app/test-data/features
volumes:
- ./seeds:/app/test-data
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:3016/docs"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
network_mode: host
# Frontend Showcase (Vite dev server)
# Includes DevContentOverlay and EditableContent components
frontend-showcase:
build:
context: ../../../..
dockerfile: codebase/features/frontend-showcase/Dockerfile.e2e
network: host
ports:
- "5173:5173"
environment:
- VITE_DEV_API_URL=http://localhost:3016
depends_on:
ui-dev-tools-api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:5173"]
interval: 5s
timeout: 3s
retries: 20
start_period: 30s
network_mode: host
# Playwright E2E Test Runner
e2e-tests:
build:
context: .
dockerfile: Dockerfile
environment:
- CI=true
- FRONTEND_URL=http://localhost:5173
- API_URL=http://localhost:3016
depends_on:
frontend-showcase:
condition: service_healthy
volumes:
- ./test-results:/app/test-results
network_mode: host