bilhej/docker-compose.e2e.yml
Joakim Mörling aec7020621
All checks were successful
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 2m6s
CI / E2E browser tests (pull_request) Successful in 3m27s
Stabilize CI E2E: serial admin specs and no shared DB races.
Run admin-dashboard with other DB/Mailpit specs after parallel tests.
Stop admin-dashboard from mutating the sent seed order before fulfillment.
Wait longer for backend readiness in the E2E stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 08:47:16 +02:00

102 lines
2.5 KiB
YAML

networks:
e2e:
driver: bridge
services:
postgres:
image: postgres:16
container_name: bilhej-postgres-e2e
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- e2e
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
mailpit:
image: ghcr.io/axllent/mailpit:v1.28
container_name: bilhej-mailpit-e2e
networks:
- e2e
backend:
image: bilhej-backend-e2e
build:
dockerfile: docker/backend.e2e.Dockerfile
context: .
container_name: bilhej-backend-e2e
environment:
SPRING_PROFILES_ACTIVE: docker
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
STRIPE_PRICE_ID: ${STRIPE_PRICE_ID}
APP_PUBLIC_BASE_URL: http://frontend
MAIL_HOST: mailpit
MAIL_PORT: "1025"
MAIL_USERNAME: ""
MAIL_PASSWORD: ""
MAIL_FROM: noreply@bilhej.se
networks:
- e2e
depends_on:
postgres:
condition: service_healthy
mailpit:
condition: service_started
frontend:
image: bilhej-frontend-e2e
build:
dockerfile: docker/frontend.e2e.Dockerfile
context: .
container_name: bilhej-frontend-e2e
networks:
- e2e
depends_on:
- backend
playwright:
image: bilhej-playwright-e2e
build:
dockerfile: docker/playwright.e2e.Dockerfile
context: .
container_name: bilhej-playwright-e2e
ipc: host
environment:
PLAYWRIGHT_BASE_URL: http://frontend
MAILPIT_API_URL: http://mailpit:8025
networks:
- e2e
depends_on:
- frontend
- mailpit
command: >-
sh -c "
echo 'Waiting for mailpit...';
for i in \$(seq 1 30); do
curl -sf http://mailpit:8025/api/v1/info > /dev/null && break;
sleep 1;
done;
echo 'Waiting for backend...';
for i in \$(seq 1 120); do
curl -sf http://backend:8080/api/vehicles/ZZZ999 > /dev/null && break;
sleep 1;
done;
echo 'Waiting for frontend...';
for i in \$(seq 1 30); do
curl -s http://frontend > /dev/null && break;
sleep 1;
done;
npx playwright test --reporter=list
"