Traefik - 502 Bad Gateway

Viewed 1618

Hello,

I'm trying to connect a Docker container to Traefik. It doesn't work.

I can't access my container through the host.

I tried several things: check the ports, check if the containers are on the same network, stop and restart the networks, check if there is an error, etc. Impossible to see where it comes from. :(

I have an another two another containers that already work with Traefik. But this container doesn't want...

I've been banging my head on it for two days now that I have a bump on my forehead the size of a horn.

My traefik docker logs :

msg="'502 Bad Gateway' caused by: dial tcp 172.23.0.6:5345: connect: connection refused"

My Docker compose file :

services:
  db:
    image: mariadb:10.3
    env_file:
      - env/mysql.env
    volumes:
      - database_volume:/var/lib/mysql
        #ports:
        #- "127.0.0.1:3306:3306"
    networks:
      - traefik-public

  passbolt:
    image: passbolt/passbolt:latest-ce
    #Alternatively you can use rootless:
    #image: passbolt/passbolt:latest-ce-non-root
    tty: true
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik-public
      - traefik.constraint-label=traefik-public
      - traefik.http.routers.vault-https.rule=Host(`vault.audiowizard.fr`)
      - traefik.http.routers.vault-https.entrypoints=websecure      
      - traefik.http.routers.vault-https.tls=true      
      - traefik.http.routers.vault-https.tls.certresolver=lets-encrypt      
      - traefik.http.services.vault-https.loadbalancer.server.port=5345          
    depends_on:      
      - db 
    env_file:
      - env/passbolt.env
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - images_volume:/usr/share/php/passbolt/webroot/img/public
    command: ["/usr/bin/wait-for.sh", "-t", "0", "db:3306", "--", "/docker-entrypoint.sh"]
    networks:
      - traefik-public
   #ports:
     #- 5080:80
     #- 5443:443
    #Alternatively for non-root images:
    # - 80:8080
    # - 443:4433

volumes:
  database_volume:
  gpg_volume:
  images_volume:

networks:
  traefik-public:
    external: true
1 Answers

I noticed in the commented code you have used the following ports.

#ports:
  #- 5080:80
  #- 5443:443
#Alternatively for non-root images:
  # - 80:8080
  # - 443:4433

But the port you have used in the label is 5343,

- traefik.http.services.vault-https.loadbalancer.server.port=5345 

Can you please double check if this is the right port?

Related