kombu.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. version: '3'
  2. services:
  3. mq:
  4. image: redis:latest
  5. expose:
  6. - '6379'
  7. postgres:
  8. image: postgres:latest
  9. expose:
  10. - '5432'
  11. environment:
  12. - POSTGRES_HOST=postgres
  13. - POSTGRES_USER=user
  14. - POSTGRES_PASSWORD=pswd
  15. - POSTGRES_DB=replica
  16. - POSTGRES_HOST_AUTH_METHOD=md5
  17. - POSTGRES_INITDB_ARGS=--auth-host=md5
  18. replica:
  19. build:
  20. context: ..
  21. dockerfile: integration_tests/Dockerfile.Replica
  22. restart: always
  23. command: >
  24. bash -c "
  25. dockerize -wait tcp://mq:6379 -wait tcp://postgres:5432 -timeout 60s &&
  26. python manage.py makemigrations --settings=integration_tests.replica_settings &&
  27. python manage.py makemigrations dj_replica --settings=integration_tests.replica_settings &&
  28. python manage.py migrate --settings=integration_tests.replica_settings &&
  29. python manage.py cqrs_consume -w 2 --settings=integration_tests.replica_settings
  30. "
  31. container_name: django_cqrs_test_replica
  32. depends_on:
  33. - mq
  34. - postgres
  35. volumes:
  36. - ../dj_cqrs:/replica/dj_cqrs
  37. environment:
  38. - POSTGRES_HOST=postgres
  39. - POSTGRES_USER=user
  40. - POSTGRES_PASSWORD=pswd
  41. - POSTGRES_DB=replica
  42. - CQRS_REPLICA_TRANSPORT=tests.dj.transport.KombuTransportWithEvents
  43. - CQRS_BROKER_URL=redis://mq:6379/
  44. master:
  45. build:
  46. context: ..
  47. dockerfile: integration_tests/Dockerfile.Master
  48. command: >
  49. bash -c "
  50. dockerize -wait tcp://mq:6379 -wait tcp://postgres:5432 -timeout 60s &&
  51. ./run_integration_tests.sh
  52. "
  53. container_name: django_cqrs_test_master
  54. depends_on:
  55. - mq
  56. - replica
  57. volumes:
  58. - ./tests/:/master/integration_tests/tests
  59. - ../dj_cqrs:/master/dj_cqrs
  60. environment:
  61. - CQRS_MASTER_TRANSPORT=dj_cqrs.transport.KombuTransport
  62. - CQRS_BROKER_URL=redis://mq:6379/