#StackBounty: #.net #docker #configuration #traefik #swarm Traefik won't route path

Bounty: 50

To test Traefik I have made an app like whoami shown in the Traefik’s getting stated documentation that responds with a friendly message to a GET HTTP request to ‘/’ and ‘/sub’ endpoints. I’ve verified that changing whoami to answer through different paths indeed does works but for some reason, Traefik won’t resolve my app even though I’ve configured it similarly as I did with whoami. I know the first thing that comes to mind is that if I’ve configured my app the same way as I did with whoami so the problem would be my app but curl does confirm that I can reach my app from Traefik’s container so it got me wondering if there’s something baked into Traefik that whoami app would work and mine wouldn’t. I know that’s a silly assumption but I don’t see what else my app needs to do besides to respond to an HTTP Get request. You can see the app and how I’m bringing everything up here, just need to see build.sh. Another problem that I did work around it is configuring Traefik in swarm mode which I had to create a Traefik image instead of passing the configuration as an argument. The main configuration shows in the code below and traefik_rp its just an image of traefik with a tom file to set it as sarmMode.

version: '3'

    # The official v2 Traefik docker image
    image: traefik_rp
    # Enables the web UI and tells Traefik to listen to docker
    command: --api.insecure=true --providers.docker
      # The HTTP port
      - "80:80"
      # The Web UI (enabled by --api.insecure=true)
      - "8080:8080"
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
    image: simpleapp
      - "traefik.http.routers.simple_app_service.rule=Path(`/simpleapp`)"

    # A container that exposes an API to show its IP address
    image: containous/whoami
      - "traefik.http.routers.whoami.rule=Path(`/`)"

Best regards.

Get this bounty!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.