From 6bb0a0300ef168cd91b7f49f04446114766b7e6c Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Tue, 6 Aug 2024 00:29:37 +0000 Subject: [PATCH] rust webhook server should bind to all interfaces Add the rust webhook server to the docker compose for k6 account service --- docker-compose-k6.account.yaml | 30 +++++++++++++++++-- .../account/rust-webhook-server/src/main.rs | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docker-compose-k6.account.yaml b/docker-compose-k6.account.yaml index c0c6445e..f935d6c6 100644 --- a/docker-compose-k6.account.yaml +++ b/docker-compose-k6.account.yaml @@ -11,8 +11,15 @@ services: - 3000:3000 volumes: !reset [] depends_on: !override - - redis - - ipfs + redis: + condition: service_started + ipfs: + condition: service_healthy + account-service-webhook: + condition: service_healthy + environment: + PROVIDER_BASE_URL: 'http://account-service-webhook:3001/webhooks/account-service' + WEBHOOK_BASE_URL: 'http://account-service-webhook:3001/webhooks' account-service-worker: pull_policy: never @@ -24,6 +31,25 @@ services: depends_on: !override - redis - ipfs + environment: + PROVIDER_BASE_URL: 'http://account-service-webhook:3001/webhooks/account-service' + WEBHOOK_BASE_URL: 'http://account-service-webhook:3001/webhooks' + + account-service-webhook: + image: rust:1.80.0 + volumes: + - ./services/account/rust-webhook-server:/app + ports: + - '3001:3001' + command: sh -c "cd /app && cargo run" + healthcheck: + test: ['CMD', 'curl', '-f', 'http://127.0.0.1:3001/webhooks/health'] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + networks: + - amplica-gateway gateway-base: profiles: diff --git a/services/account/rust-webhook-server/src/main.rs b/services/account/rust-webhook-server/src/main.rs index 5605ef5c..b6f7eade 100644 --- a/services/account/rust-webhook-server/src/main.rs +++ b/services/account/rust-webhook-server/src/main.rs @@ -22,7 +22,7 @@ const WEBHOOK_ENDPOINT: &str = "/account-service"; #[actix_web::main] async fn main() -> Result<(), impl Error> { - const HOST: Ipv4Addr = Ipv4Addr::new(127, 0, 0, 1); + const HOST: Ipv4Addr = Ipv4Addr::new(0, 0, 0, 0); const PORT: u16 = 3001; env_logger::init(); println!(