refactor: ( payment ) use rabbitmq for webhooks event

This commit is contained in:
Abubeker Yasin
2026-06-13 20:19:23 +03:00
parent eb94d58a4e
commit c35b5089ce
17 changed files with 396 additions and 10 deletions

View File

@@ -6,6 +6,24 @@
# Run: docker compose up -d
services:
# Message broker for payment event delivery (payment-api -> passenger/freight).
# Management UI: http://localhost:15672 (login edr / edr_secret). vhost: payment.
# In deployed envs this is a shared/managed RabbitMQ; only PAYMENT_RABBITMQ_URL changes.
rabbitmq:
image: rabbitmq:3.13-management
ports:
- "5672:5672" # AMQP — apps connect here
- "15672:15672" # management UI
environment:
RABBITMQ_DEFAULT_USER: edr
RABBITMQ_DEFAULT_PASS: edr_secret
RABBITMQ_DEFAULT_VHOST: payment
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
freight-api:
build:
context: .
@@ -25,6 +43,9 @@ services:
- "${PASSENGER_API_PORT:-4000}:${PASSENGER_API_PORT:-4000}"
env_file:
- apps/edr-passenger-api/.env
depends_on:
rabbitmq:
condition: service_healthy
freight-portal:
build:
@@ -96,6 +117,9 @@ services:
- "${PAYMENT_API_PORT:-3008}:${PAYMENT_API_PORT:-3008}"
env_file:
- apps/edr-payment-api/.env
depends_on:
rabbitmq:
condition: service_healthy
secrets:
npmrc: