Skip to content

Commit

Permalink
rust webhook server should bind to all interfaces
Browse files Browse the repository at this point in the history
Add the rust webhook server to the docker compose for k6 account service
  • Loading branch information
wilwade committed Aug 6, 2024
1 parent 929d312 commit 6bb0a03
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
30 changes: 28 additions & 2 deletions docker-compose-k6.account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion services/account/rust-webhook-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 6bb0a03

Please sign in to comment.