How can I setup hasura docker compose and traefik to access outside api for actions

172 Views Asked by At

I'm setting up 3 docker-compose file one contains the treafik proxy, the other one is my api to handle actions, and lastly a hasura service.

My problem is having my hasura actions connect to the other service define in a different docker-compose file. When doing query with hasura console I'm able to retrieve records but when doing some actions I keep getting http exception when calling webhook.

I checked the actions url and it works fine so I'm not sure why hasura is not able to connect with it.

Thanks

Expecting to have hasura connect with the actions url.

1

There are 1 best solutions below

0
On

Try to create custom network in docker:

docker network create hasura-net

Add this network to all services in your docker-compose files, so that they use the same hasura-net. I put it in one config here for convenience.

version: "3"
services:
  api:
    networks:
      - hasura-net
  hasura:
    networks:
      - hasura-net
  traefik:
    networks:
      - hasura-net

networks:
  hasura-net:
    external: true