compose.briven-engine.local.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Local Doltgres only for briven-engine Auth DB (NO SuperTokens Core, NO stock Postgres).
  2. #
  3. # export BRIVEN_DOLTGRES_PASSWORD=devpass
  4. # docker-compose -f infra/dokploy/compose.briven-engine.local.yml up -d
  5. #
  6. # API:
  7. # BRIVEN_ENGINE_DATABASE_URL=postgres://postgres:devpass@127.0.0.1:5434/briven_engine?sslmode=disable
  8. # BRIVEN_DATA_PLANE_URL=postgres://postgres:devpass@127.0.0.1:5434/postgres?sslmode=disable
  9. services:
  10. doltgres:
  11. image: dolthub/doltgresql@sha256:0483137d0309598d3b0c111dff85d565077bd91cb0524ce00bb832929d5d5ddc
  12. environment:
  13. DOLTGRES_USER: postgres
  14. DOLTGRES_PASSWORD: ${BRIVEN_DOLTGRES_PASSWORD:-devpass}
  15. ports:
  16. - '5434:5432'
  17. healthcheck:
  18. test: ['CMD-SHELL', 'pg_isready -h 127.0.0.1 -p 5432 -U postgres']
  19. interval: 5s
  20. timeout: 3s
  21. retries: 15
  22. start_period: 20s
  23. networks:
  24. - briven-engine-local
  25. labels:
  26. - 'briven.db=doltgres'
  27. briven-engine-db-init:
  28. image: dolthub/doltgresql@sha256:0483137d0309598d3b0c111dff85d565077bd91cb0524ce00bb832929d5d5ddc
  29. restart: 'no'
  30. depends_on:
  31. doltgres:
  32. condition: service_healthy
  33. environment:
  34. PGPASSWORD: ${BRIVEN_DOLTGRES_PASSWORD:-devpass}
  35. entrypoint:
  36. - /bin/sh
  37. - -c
  38. - |
  39. set -e
  40. exists=$$(psql -h doltgres -U postgres -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname='briven_engine'" || true)
  41. if [ "$$exists" = "1" ]; then
  42. echo "briven_engine exists on doltgres"
  43. else
  44. psql -h doltgres -U postgres -d postgres -c 'CREATE DATABASE briven_engine'
  45. echo "created briven_engine on doltgres"
  46. fi
  47. networks:
  48. - briven-engine-local
  49. networks:
  50. briven-engine-local:
  51. name: briven-engine-local