please help! I am trying to start a service SonarQube with proxy Traefik. But all time have error 404. Please help me configure traefik to expose my services on swarm. We are going to deploy more than 10 servicies.
My swarm.yml:
version: "3.7"
services: traefik:
image: "traefik:v2.1"
networks:
- traefik-public
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/traefik.yml:ro
sonar:
image: sonarqube:8.9-community
networks:
- pg-net
- traefik-public
ports:
- "9000:9000"
environment:
- SONAR_JDBC_URL=jdbc:postgresql://sqdb:5432/sonarqube
- SONAR_JDBC_USERNAME=sonarqube
- SONAR_JDBC_PASSWORD=N1eC7ALj1P1bOf4!wyhQi
labels:
- "traefik.port=9000"
- "traefik.docker.network=traefik-public"
- "traefik.enable=true"
- "traefik.http.routers.sonar.entrypoints=web"
- "traefik.http.routers.sonar.rule=Host('sonar.example.com')"
networks: traefik-public:
external: true
Example of traefik.yml:
## STATIC CONFIGURATION
log:
level: INFO
api:
insecure: true
dashboard: true
entryPoints:
web:
address: ":80"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
swarmMode: true