Questions regarding loadbalancer and Ports

Hi

I got a docker compose setup with traefik and a bunch of services. Right now most things are working fine but I dont understand why loadbalancer is routing perfectly and the other isnt.

First of all my setup. I got one docker compose file root/docker-compose with traefik and the other services in extra compose files.

version: "3"
services:
 traefik:
  image: traefik:latest
  container_name: "Traefik"
  restart: unless-stopped
  command:
       - "--log.level=DEBUG"
       - "--api.insecure=true"
       - "--providers.docker=true"
       - --entryPoints.web.address=:80
  ports:
    - "80:80"
    - "8080:8080"
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.traefik.loadbalancer.server.port=8080"
    - "traefik.http.routers.traefik.entrypoints=web"
    - "traefik.http.routers.traefik.rule=Host(`traefik.local`)"

  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:ro"

Now I added a service in root/wiki/compose.yml and a website in /root/website/compose.yml and added an entry in the /root/.env

COMPOSE_PATH_SEPARATOR=:
COMPOSE_FILE=wiki/compose.yml:website/compose.yml

this is working fine so far.
now only one of the files is working with the correct port. here are my files:

version: "3"
services:
 website:
  image: nginx
  container_name: "Website"     
  restart: unless-stopped
  ports:
    - 8004:80
  labels:     
    - "traefik.enable=true"  
    - "traefik.http.routers.website.rule=Host(`website.local`)"    
    - traefik.http.services.website.loadbalancer.server.port=80
    - "traefik.http.routers.website.entrypoints=web"   
  volumes:      
  - ./conf.d:/etc/nginx/conf.d/
  - ./html:/usr/share/nginx/html/

and here the wiki

version: "3" 
services:    
   

  xwiki:     
   image: xwiki:stable-postgres     
   container_name: "XWiki"     
   restart: unless-stopped     
   depends_on:       
    - traefik       
    - postgresWiki    
   labels:     
    - "traefik.enable=true"   
    - "traefik.http.services.wiki.loadbalancer.server.port=8080"
    - "traefik.http.routers.wiki.entrypoints=web"   
    - "traefik.http.routers.wiki.rule=Host(`wiki.local`)"

   environment:       
    - DB_HOST=Postgres       
    - DB_USER=xwiki       
    - DB_PASSWORD=xwiki     
   volumes:       
    - xwiki:/usr/local/xwiki
   ports:
    - "8005:8080"

  postgresWiki:     
    image: postgres:alpine     
    container_name: "PostgresWiki"     
    restart: unless-stopped     
    ports:       
    - "5432:5432"     
    volumes:       
    - postgres:/var/lib/postgresql/data       
    - "./postgres:/docker-entrypoint-initdb.d"     
    environment:       
    - "POSTGRES_PASSWORD=adminpwd"

volumes:
 postgres:
 xwiki:

When I go to wiki.local everything I get redirected by traefik. the website on the other hand does not work. website.local:8004 works though. What do I have to change to get website.local(:80) working?

Thank you in advance
fgagfdg

About the only thing I see is that this label is not quoted like the other, I'm not certain if that is enough to break this router though.

What is your result when you try the website ?

I added the quotes but it didnt change anything. When I try website.local i get "Bad Gateway" and with website.local:8004 i get the correct html page. So I highly suspect the loadbalancer is not working for some reason.

That is pretty classic of the traefik and service not being on the same docker network. Or traefik having more than one network to choose from.

Compose will create a project level default network if you do not define networks in the compose files.
It does seem strange that one of your services is working but not the other though...

So check that all these containers are on the same network or at least share a network.
If you're doing more than one network these options will help:
https://docs.traefik.io/providers/docker/#network
https://docs.traefik.io/routing/providers/docker/#traefikdockernetwork