stack.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Use tech_user/secret as user/password credentials
  2. version: '3'
  3. services:
  4. db:
  5. image: postgres:11
  6. environment:
  7. POSTGRES_PASSWORD: example
  8. restart: always
  9. command:
  10. - -c
  11. - max_prepared_transactions=100
  12. bonita:
  13. image: bonita
  14. ports:
  15. - 8080:8080
  16. environment:
  17. - POSTGRES_ENV_POSTGRES_PASSWORD=example
  18. - DB_VENDOR=postgres
  19. - DB_HOST=db
  20. - TENANT_LOGIN=tech_user
  21. - TENANT_PASSWORD=secret
  22. - PLATFORM_LOGIN=pfadmin
  23. - PLATFORM_PASSWORD=pfsecret
  24. restart: on-failure:2
  25. depends_on:
  26. - db
  27. entrypoint:
  28. - bash
  29. - -c
  30. - |
  31. set -e
  32. echo 'Waiting for Postgres to be available'
  33. export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD"
  34. maxTries=10
  35. while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do
  36. let maxTries--
  37. sleep 1
  38. done
  39. echo
  40. if [ "$$maxTries" -le 0 ]; then
  41. echo >&2 'error: unable to contact Postgres after 10 tries'
  42. exit 1
  43. fi
  44. exec /opt/files/startup.sh