Files
ExcaliDash/e2e/docker-compose.e2e.yml
T
Zimeng Xiong 0476315322 0.2.1 Release (#32)
* feat(security): implement CSRF protection

* chore: clean up CSRF implementation

  - Remove unused generateCsrfToken export from security.ts
  - Remove redundant /csrf-token path check (GET already exempt)
  - Restore defineConfig wrapper in vitest.config.ts for type safety

* add K8S note in README, fix broken e2e

* feat/upload-bar (#30)

* feat/upload-bar: add a upload bar when user upload file, indicate the upload process

* feat/save-loading-status: add save status when click back button from editor

* fix: address PR review issues in upload and save features

- Replace deprecated substr() with substring() in UploadContext
- Fix broken error handling that checked stale task status
- Fix missing useEffect dependency in UploadStatus
- Fix CSS class conflict in progress bar styling
- Add error recovery for save state in Editor (reset on failure)
- Use .finally() instead of .then() to ensure refresh on upload failure
- Fix inconsistent indentation in UploadContext

* fix e2e tests

---------

Co-authored-by: Zimeng Xiong <zxzimeng@gmail.com>

* chore: pre-release v0.2.1-dev

* Update backend/src/security.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix filename/math random UUID generation

---------

Co-authored-by: AdrianAcala <adrianacala017@gmail.com>
Co-authored-by: adamant368 <60790941+Yiheng-Liu@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-14 11:25:27 -08:00

85 lines
2.4 KiB
YAML

version: "3.8"
# Docker Compose for E2E Browser Testing
# This provides a repeatable environment for running Playwright tests
# with full browser automation against the real frontend and backend.
#
# Usage:
# docker-compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
#
# For headed mode (requires X11):
# HEADED=true docker-compose -f docker-compose.e2e.yml up --build
services:
# Backend API server
backend:
build:
context: ../backend
dockerfile: Dockerfile
environment:
# Use an absolute sqlite path so Prisma CLI + the running app always point
# at the same DB file (avoids schema being applied to a different relative path).
- DATABASE_URL=file:/app/prisma/e2e-test.db
- PORT=8000
- NODE_ENV=test
# Include both with and without :80 because browsers omit default ports in Origin.
- FRONTEND_URL=http://frontend,http://frontend:80,http://localhost:5173
ports:
- "8000:8000"
healthcheck:
# Use IPv4 loopback explicitly to avoid IPv6 localhost resolution issues.
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8000/health"]
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
networks:
- e2e-network
# Frontend web server
frontend:
build:
# Use the repo root as build context because `frontend/Dockerfile` expects
# `frontend/...` paths (same as production `docker-compose.yml`).
context: ..
dockerfile: frontend/Dockerfile
ports:
- "5173:80"
depends_on:
backend:
condition: service_healthy
healthcheck:
# Use IPv4 loopback explicitly to avoid IPv6 localhost resolution issues.
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:80"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- e2e-network
# Playwright test runner
playwright:
build:
context: .
dockerfile: Dockerfile.playwright
depends_on:
frontend:
condition: service_healthy
backend:
condition: service_healthy
environment:
- BASE_URL=http://frontend:80
- API_URL=http://backend:8000
- NO_SERVER=true
- CI=true
volumes:
- ./test-results:/app/test-results
- ./playwright-report:/app/playwright-report
networks:
- e2e-network
networks:
e2e-network:
driver: bridge