Hello,
I am starting using Traefik and I a struggling to set it up. I am using docker-compose.
I have two subdomains pointing to the ip of my VPS with the following target
- vps.labonnefabrique-point-fr (sorry I hit the limit of authorized url in a post): everything about the core vps, Traefik and something like dockProm to monitor the vps. For know, only traefik is setup and listening on 8080
- graphql.labonnefabrique-point-fr : hasura graphql endpoind. The app exposes its ports to 8082
I read the docs and followed the tutorials of https://containo.us/blog/traefik-2-0-docker-101-fc2893944b9d/ . I succeeded in making the example " My Application Listens on a Specific Port" to work.
But I am struggling to succeed in making my case working. Here is my docker-compose.yml
version: "3.3"
services:
traefik:
image: "traefik:v2.0.1"
command:
- --entrypoints.web.address=:80
- --providers.docker
- --api.insecure
- --providers.docker.endpoint=unix:///var/run/docker.sock
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
postgres:
image: postgres
restart: always
volumes:
- "./db_data:/var/lib/postgresql/data"
graphql-engine:
image: hasura/graphql-engine:v1.0.0
ports:
- "8082:8080"
labels:
- traefik.http.routers.graphql-engine.rule=Host(`graphql.labonnefabrique.fr`)
- traefik.http.services.graphql-engine.loadbalancer.server.port=8082
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
What I expected is that http://vps.labonnefabrique-point-fr-:-8080 gets to the Traefik dashboard and graphql.labonnefabrique -point- fr gets to the graphql endpoint.
What I got:
- vps.labonnefabrique.fr-:8080/ get to Traefik dashboard but http://vps.labonnefabrique.fr-:8082/ to the graphql end point
- graphql.labonnefabrique -point- fr/ give a bad gateway error, http://graphql.labonnefabrique.fr-:8082 leads to the graphql end point and http://graphql.labonnefabrique.fr-:8080 to the Traefik dashboard.
I don't understand what is wrong with my config. Could someone point me to the right direction?
Thanks