Files
metabuilder/deployment/docker-compose.smoke.yml
Claude 659324c823 fix(ci): build all container images to GHCR before E2E tests
Move Gate 7 container builds (base images T1→T2→T3 + app images) to
run right after Gate 1 instead of after Gate 3. Gate 2 (E2E) now
depends on container-build-apps completing, so the smoke stack pulls
prod images from GHCR — no special E2E images, same images used
everywhere.

- container-base-tier1 needs gate-1-complete (was gate-3-complete)
- container-build-apps runs on all events including PRs
- All images push: true unconditionally (E2E needs them in GHCR)
- E2E just logs into GHCR, smoke compose pulls via image: directives
- Added dbal + dbal-init to Gate 7 app matrix

https://claude.ai/code/session_01ChKf8wbKQLBcNbBCtqCwT6
2026-03-11 21:03:24 +00:00

222 lines
6.2 KiB
YAML

# docker-compose.smoke.yml — Smoke test stack for CI.
#
# Includes a real DBAL daemon backed by PostgreSQL so E2E tests can seed
# and query data. Admin tools (phpMyAdmin, Mongo Express, RedisInsight)
# and an nginx gateway round out the stack.
#
# Usage:
# docker compose -f deployment/docker-compose.smoke.yml up -d --wait
# PLAYWRIGHT_BASE_URL=http://localhost/workflowui/ npx playwright test e2e/deployment-smoke.spec.ts
# docker compose -f deployment/docker-compose.smoke.yml down -v
services:
# ── Gateway stub ──────────────────────────────────────────────────────────
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./config/nginx-smoke/default.conf:/etc/nginx/conf.d/default.conf:ro
# host.docker.internal lets nginx proxy to playwright's webServer processes
# running on the host (workflowui :3000, pastebin :3001).
# On Linux (GitHub Actions) this requires the host-gateway extra_host.
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
dbal:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1/"]
interval: 5s
timeout: 3s
retries: 10
networks:
- smoke
# ── DBAL + PostgreSQL ────────────────────────────────────────────────────
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: metabuilder
POSTGRES_PASSWORD: metabuilder
POSTGRES_DB: metabuilder
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metabuilder"]
interval: 5s
timeout: 3s
retries: 10
networks:
- smoke
dbal-init:
image: ${DBAL_INIT_IMAGE:-ghcr.io/johndoe6345789/metabuilder/dbal-init:latest}
build:
context: ..
dockerfile: deployment/config/dbal/Dockerfile.init
volumes:
- dbal-schemas:/target/schemas/entities
- dbal-templates:/target/templates/sql
networks:
- smoke
dbal:
image: ${DBAL_IMAGE:-ghcr.io/johndoe6345789/metabuilder/dbal:latest}
build:
context: ../dbal
dockerfile: production/build-config/Dockerfile
ports:
- "8080:8080"
environment:
DBAL_ADAPTER: postgres
DATABASE_URL: "postgresql://metabuilder:metabuilder@postgres:5432/metabuilder"
DBAL_SCHEMA_DIR: /app/schemas/entities
DBAL_TEMPLATE_DIR: /app/templates/sql
DBAL_SEED_DIR: /app/seeds/database
DBAL_SEED_ON_STARTUP: "true"
DBAL_BIND_ADDRESS: 0.0.0.0
DBAL_PORT: 8080
DBAL_MODE: production
DBAL_DAEMON: "true"
DBAL_LOG_LEVEL: info
DBAL_AUTO_CREATE_TABLES: "true"
DBAL_ENABLE_HEALTH_CHECK: "true"
DBAL_ADMIN_TOKEN: "smoke-test-admin-token"
DBAL_CORS_ORIGIN: "*"
JWT_SECRET_KEY: "test-secret"
volumes:
- dbal-schemas:/app/schemas/entities:ro
- dbal-templates:/app/templates/sql:ro
depends_on:
dbal-init:
condition: service_completed_successfully
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/health"]
interval: 5s
timeout: 3s
retries: 15
start_period: 10s
networks:
- smoke
# ── Infrastructure (stock images) ─────────────────────────────────────────
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: metabuilder
MYSQL_USER: metabuilder
MYSQL_PASSWORD: metabuilder
MYSQL_DATABASE: metabuilder
command: --default-authentication-plugin=mysql_native_password
tmpfs:
- /var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-pmetabuilder"]
interval: 5s
timeout: 5s
retries: 15
start_period: 20s
networks:
- smoke
mongodb:
image: mongo:7.0
environment:
MONGO_INITDB_ROOT_USERNAME: metabuilder
MONGO_INITDB_ROOT_PASSWORD: metabuilder
tmpfs:
- /data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
interval: 5s
timeout: 5s
retries: 15
networks:
- smoke
redis:
image: redis:7-alpine
tmpfs:
- /data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 3s
retries: 10
networks:
- smoke
# ── Admin tools (real containers, specific ports to match smoke tests) ────
phpmyadmin:
image: phpmyadmin:latest
ports:
- "8081:80"
environment:
PMA_HOST: mysql
PMA_PORT: "3306"
PMA_USER: metabuilder
PMA_PASSWORD: metabuilder
MYSQL_ROOT_PASSWORD: metabuilder
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-sf", "http://127.0.0.1/"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
networks:
- smoke
mongo-express:
image: mongo-express:latest
ports:
- "8082:8081"
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: metabuilder
ME_CONFIG_MONGODB_ADMINPASSWORD: metabuilder
ME_CONFIG_MONGODB_URL: mongodb://metabuilder:metabuilder@mongodb:27017/?authSource=admin
ME_CONFIG_BASICAUTH: "false"
depends_on:
mongodb:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:8081/"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
networks:
- smoke
redisinsight:
image: redis/redisinsight:latest
ports:
- "8083:5540"
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:5540/api/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
networks:
- smoke
volumes:
dbal-schemas:
driver: local
dbal-templates:
driver: local
networks:
smoke:
driver: bridge