super-productivity/docker-compose.e2e.yaml
Johannes Millan 2fa804c07a refactor(e2e): migrate to production Dockerfile for E2E tests
Complete E2E Docker migration (Steps 1-3):

1. Add SPA routing support in nginx (try_files directive)
2. Make APP_PORT configurable via environment variable
3. Migrate docker-compose.e2e.yaml from dev server to production build

Changes:
- docker-compose.e2e.yaml: Use production Dockerfile instead of dev server
  - Remove volume mounts (self-contained production build)
  - Add UNSPLASH build args
  - Add WEBDAV_BACKEND environment variable
  - Reduce healthcheck start_period from 120s to 30s (nginx is faster)
- nginx/default.conf.template: Add try_files for SPA routing, use APP_PORT
- docker-entrypoint.sh: Export APP_PORT with default value

Benefits:
- Production build provides more realistic test environment
- Faster startup (30s vs 120s)
- No dependency on local node_modules
- Matches production deployment more closely
2026-01-21 14:30:24 +01:00

54 lines
1.5 KiB
YAML

# Docker Compose override for E2E tests
# Note: For supersync tests, use both files: -f docker-compose.yaml -f docker-compose.e2e.yaml
# This file is standalone for app/webdav tests only
#
# FAST LOCAL ALTERNATIVE: Run `ng serve` locally + `npm run e2e:webdav` (only webdav in Docker)
services:
# Production Angular build for E2E tests
# Uses production Dockerfile with nginx
app:
build:
context: .
dockerfile: Dockerfile
args:
UNSPLASH_KEY: ${UNSPLASH_KEY:-DUMMY_UNSPLASH_KEY}
UNSPLASH_CLIENT_ID: ${UNSPLASH_CLIENT_ID:-DUMMY_UNSPLASH_CLIENT_ID}
ports:
- '${APP_PORT:-4242}:${APP_PORT:-4242}'
environment:
- APP_PORT=${APP_PORT:-4242}
- WEBDAV_BACKEND=${WEBDAV_BACKEND:-}
healthcheck:
test: ['CMD', 'curl', '-sf', 'http://localhost:${APP_PORT:-4242}']
interval: 10s
timeout: 5s
retries: 30
start_period: 30s
# WebDAV sync server (for sync tests)
webdav:
image: hacdias/webdav:latest
ports:
- '${WEBDAV_PORT:-2345}:${WEBDAV_PORT:-2345}'
environment:
- PORT=${WEBDAV_PORT:-2345}
volumes:
- ./webdav.yaml:/config.yml:ro
- webdav_data:/data
healthcheck:
test:
[
'CMD',
'wget',
'--quiet',
'--tries=1',
'--spider',
'http://localhost:${WEBDAV_PORT:-2345}/',
]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
webdav_data: