103 lines
2.6 KiB
YAML
Executable file
103 lines
2.6 KiB
YAML
Executable file
# Status Dashboard E2E Test Environment
|
|
#
|
|
# Self-contained Docker environment for Playwright E2E tests.
|
|
# Uses SQLite (file-based) so no external database needed.
|
|
#
|
|
# Usage:
|
|
# docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
|
|
# docker compose -f docker-compose.e2e.yml down -v
|
|
|
|
services:
|
|
# Redis for BullMQ queues
|
|
redis:
|
|
image: redis:7-alpine
|
|
command: redis-server --appendonly yes
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- e2e-network
|
|
|
|
# Backend API (NestJS with SQLite + Redis)
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: e2e/Dockerfile.api
|
|
args:
|
|
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
|
|
environment:
|
|
NODE_ENV: test
|
|
PORT: 5000
|
|
# SQLite database path (in-container)
|
|
DATABASE_PATH: /app/data/status-dashboard.db
|
|
# Redis connection
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
# Disable auto-start of dependencies in Docker
|
|
LILITH_DEPENDENCY_STARTUP_DISABLED: "true"
|
|
volumes:
|
|
- api-data:/app/data
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://localhost:5000/api/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
networks:
|
|
- e2e-network
|
|
|
|
# Frontend (Vite preview server)
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: e2e/Dockerfile.frontend
|
|
args:
|
|
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
|
|
environment:
|
|
NODE_ENV: test
|
|
VITE_API_URL: http://api:5000
|
|
VITE_WS_URL: http://api:5000
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
networks:
|
|
- e2e-network
|
|
|
|
# Playwright E2E test runner
|
|
e2e-tests:
|
|
build:
|
|
context: .
|
|
dockerfile: e2e/Dockerfile.e2e
|
|
args:
|
|
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
|
|
environment:
|
|
CI: "true"
|
|
BASE_URL: http://frontend:3000
|
|
API_URL: http://api:5000
|
|
depends_on:
|
|
frontend:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./frontend-public/test-results:/app/test-results
|
|
- ./frontend-public/playwright-report:/app/playwright-report
|
|
command: ["pnpm", "exec", "playwright", "test", "--config=playwright.docker.config.ts"]
|
|
networks:
|
|
- e2e-network
|
|
|
|
networks:
|
|
e2e-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
api-data:
|