This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/docker-compose-e2e.yml
Jeffrey Smith 8092f00fbe
All checks were successful
CI/CD / detect-changes (push) Successful in 21s
CI/CD / test-frontend (push) Successful in 4s
CI/CD / test-sqlite (push) Successful in 2m47s
CI/CD / test-go-pg (push) Successful in 2m53s
CI/CD / build-and-deploy (push) Successful in 1m15s
Feat v0.5.3 chat polish (#33)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
2026-03-30 17:04:40 +00:00

88 lines
2.4 KiB
YAML

# docker-compose-e2e.yml — Multi-replica E2E testing (Postgres)
#
# Two Switchboard replicas behind an nginx load balancer,
# sharing a single Postgres instance. Tests cross-replica
# broadcast via pg_notify.
#
# Usage:
# docker compose -f docker-compose-e2e.yml up --build -d
# ./ci/e2e-chat-test.sh
# docker compose -f docker-compose-e2e.yml down -v
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: switchboard_e2e
POSTGRES_USER: switchboard
POSTGRES_PASSWORD: e2e-password
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U switchboard -d switchboard_e2e"]
interval: 2s
timeout: 5s
retries: 10
switchboard-1:
build:
context: .
dockerfile: Dockerfile
environment:
PORT: "8080"
BASE_PATH: ""
DB_DRIVER: postgres
DATABASE_URL: postgres://switchboard:e2e-password@postgres:5432/switchboard_e2e?sslmode=disable
JWT_SECRET: e2e-jwt-secret
ENCRYPTION_KEY: e2e-encryption-key-32chars!!!!!
SWITCHBOARD_ADMIN_USERNAME: admin
SWITCHBOARD_ADMIN_PASSWORD: admin
STORAGE_BACKEND: pvc
STORAGE_PATH: /data/storage
CORS_ALLOWED_ORIGINS: "*"
EXT_ALLOW_PRIVATE_IPS: "true"
LOG_FORMAT: text
LOG_LEVEL: info
SEED_USERS: "alice:password123:user,bob:password456:user,charlie:password789:user"
depends_on:
postgres:
condition: service_healthy
ports:
- "8081:80"
switchboard-2:
build:
context: .
dockerfile: Dockerfile
environment:
PORT: "8080"
BASE_PATH: ""
DB_DRIVER: postgres
DATABASE_URL: postgres://switchboard:e2e-password@postgres:5432/switchboard_e2e?sslmode=disable
JWT_SECRET: e2e-jwt-secret
ENCRYPTION_KEY: e2e-encryption-key-32chars!!!!!
SWITCHBOARD_ADMIN_USERNAME: admin
SWITCHBOARD_ADMIN_PASSWORD: admin
STORAGE_BACKEND: pvc
STORAGE_PATH: /data/storage
CORS_ALLOWED_ORIGINS: "*"
EXT_ALLOW_PRIVATE_IPS: "true"
LOG_FORMAT: text
LOG_LEVEL: info
SEED_USERS: "alice:password123:user,bob:password456:user,charlie:password789:user"
depends_on:
postgres:
condition: service_healthy
ports:
- "8082:80"
lb:
image: nginx:alpine
volumes:
- ./ci/e2e-nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "3000:80"
depends_on:
- switchboard-1
- switchboard-2