version: "3.8"
services:
e2e-postgresql:
image: postgres:15-alpine
container_name: oauth-db-cli-e2e-postgresql
environment:
POSTGRES_DB: oauth_db
POSTGRES_USER: oauth
POSTGRES_PASSWORD: oauth123
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "25432:5432" volumes:
- type: tmpfs
target: /var/lib/postgresql/data
- ../apps/migrations:/docker-entrypoint-initdb.d:ro
networks:
- cli-e2e-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U oauth -d oauth_db"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
e2e-redis:
image: redis:7-alpine
container_name: oauth-db-cli-e2e-redis
command: redis-server --appendonly no --save ""
ports:
- "26379:6379"
networks:
- cli-e2e-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
e2e-surrealdb:
image: surrealdb/surrealdb:latest
container_name: oauth-db-cli-e2e-surrealdb
command: >
start
--log info
--user root
--pass root
--bind 0.0.0.0:8000
ports:
- "28000:8000"
volumes:
- type: tmpfs
target: /data
networks:
- cli-e2e-net
e2e-oauth-db:
image: oauth-db:latest
container_name: oauth-db-cli-e2e-backend
environment:
RUST_LOG: info
RUST_BACKTRACE: 1
ports:
- "28080:8080" - "25555:5555" volumes:
- ../config.e2e.yaml:/app/config.yaml:ro
- ../keys:/app/keys:ro
depends_on:
e2e-postgresql:
condition: service_healthy
e2e-redis:
condition: service_healthy
e2e-surrealdb:
condition: service_started
networks:
- cli-e2e-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
cli-test-runner:
build:
context: .
dockerfile: Dockerfile.e2e
container_name: oauth-db-cli-test-runner
environment:
OAUTH_DB_SERVER: "http://e2e-oauth-db:8080"
RUST_LOG: debug
RUST_BACKTRACE: 1
CI: "true"
volumes:
- ./src:/workspace/src:ro
- ./tests:/workspace/tests:ro
- ./Cargo.toml:/workspace/Cargo.toml:ro
- ../Cargo.toml:/workspace-root/Cargo.toml:ro
- ../Cargo.lock:/workspace-root/Cargo.lock:ro
- cli-target-cache:/workspace/target
- cli-test-config:/tmp/test-config
depends_on:
e2e-oauth-db:
condition: service_healthy
networks:
- cli-e2e-net
profiles:
- test
networks:
cli-e2e-net:
driver: bridge
name: oauth-db-cli-e2e-network
volumes:
cli-target-cache:
name: oauth-db-cli-target-cache
cli-test-config:
name: oauth-db-cli-test-config