Files
ss-tools/docker-compose.e2e.yml
busya 48e3ff4503 refactor(env): unify Docker env vars — canonical AUTH_SECRET_KEY, remove JWT_SECRET fallback
Canonical variables:
  - AUTH_SECRET_KEY — JWT signing key for backend + agent (was split across
    AUTH_SECRET_KEY / JWT_SECRET)
  - SERVICE_JWT — agent→backend service token
  - No JWT_SECRET fallback: decoder fails with migration guidance if only
    JWT_SECRET is set

Compose files unified:
  - docker-compose.yml, docker-compose.enterprise-clean.yml,
    docker-compose.e2e.yml — all use AUTH_SECRET_KEY
  - build.sh generated compose now passes AUTH_SECRET_KEY + ENCRYPTION_KEY
    to backend

Env examples unified and completed:
  - .env.example — comprehensive template, all compose vars
  - .env.enterprise-clean.example — production template
  - backend/.env.example — backend-only run
  - docker/.env.agent.example — agent-only run
  - NEW: .env.current.example, .env.master.example,
    .env.e2e.example, frontend/.env.example

Tests aligned:
  - conftest sets AUTH_SECRET_KEY (canonical value matched across test files)
  - test mocks use canonical name
  - 1176 passed, 0 failed
2026-07-06 14:24:17 +03:00

80 lines
2.3 KiB
YAML

# ── superset-tools E2E test stack ─────────────────────────────────
# Isolated Docker Compose stack for Playwright E2E tests.
# Usage:
# docker compose -f docker-compose.e2e.yml up -d
# cd frontend && npm run test:e2e
#
# Environment variables (from .env.current or shell):
# BACKEND_HOST_PORT, POSTGRES_HOST_PORT, etc.
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ss_tools
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "${POSTGRES_HOST_PORT:-5435}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d ss_tools"]
interval: 5s
timeout: 3s
retries: 10
backend:
build:
context: .
dockerfile: docker/backend.Dockerfile
restart: unless-stopped
env_file:
- ./backend/.env
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg2://postgres:postgres@db:5432/ss_tools
TASKS_DATABASE_URL: postgresql+psycopg2://postgres:postgres@db:5432/ss_tools
AUTH_DATABASE_URL: postgresql+psycopg2://postgres:postgres@db:5432/ss_tools
BACKEND_PORT: 8000
AUTH_SECRET_KEY: ${AUTH_SECRET_KEY:?Set AUTH_SECRET_KEY in .env.e2e}
SERVICE_JWT: ${SERVICE_JWT:-e2e-service-secret}
INITIAL_ADMIN_CREATE: "true"
INITIAL_ADMIN_USERNAME: admin
INITIAL_ADMIN_PASSWORD: admin123
FEATURES__DATASET_REVIEW: "true"
FEATURES__HEALTH_MONITOR: "true"
ports:
- "${BACKEND_HOST_PORT:-8103}:8000"
volumes:
- e2e_storage:/app/storage
# Playwright runner (CI mode)
e2e-runner:
image: mcr.microsoft.com/playwright:v1.52.0-noble
working_dir: /workspace/frontend
depends_on:
backend:
condition: service_started
environment:
BACKEND_URL: http://backend:8000
FRONTEND_URL: http://frontend:80
E2E_USERNAME: admin
E2E_PASSWORD: admin123
GITEA_URL: https://git.bebesh.ru
GITEA_TOKEN: ${GITEA_TOKEN:-}
CI: "true"
volumes:
- .:/workspace
- /tmp/playwright-report:/workspace/frontend/playwright-report
command: >
sh -c "
npm ci --legacy-peer-deps &&
npx playwright install chromium &&
npx playwright test
"
volumes:
e2e_storage: