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