Traefik do not start

Hi, i try to move from nginx to traefik.

Traefik is not starting with a static config.
Can someone tell me why this happen?

cat config/traefik.yml
global:
  checkNewVersion: true
  sendAnonymousUsage: false
entryPoints:
  http:
    address: :80
  https:
    address: :443
cat docker-compose.yaml
services:
  traefik:
    # The official v3 Traefik docker image
    image: traefik:v3.1
    # Enables the web UI and tells Traefik to listen to docker
    command: --api.insecure=true --providers.docker
    ports:
      # The HTTP port
      - "80:80"
      # The Web UI (enabled by --api.insecure=true)
      - "8354:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/traefik/config:/etc/traefik
        #      - ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
        #      - ./certs:/etc/certs:ro

You cannot mix static configuration via yaml file with static configuration via command line parameter.

See

and

for examples.

Changed as mentioned but still having issues and don't understand it :frowning:
What I do wrong here?

Tested with both unix socket and tcp endpoint.

cat docker-compose.yaml
services:
  traefik:
    image: traefik:v3.1
    ports:
      - "80:80"
      - "443:443"
      - "8354:8080"
    volumes:
      - ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro
    networks:
      - traefik-service
networks:
  traefik-service:
    name: traefik-service
    external: true
cat config/traefik.yaml
global:
  checkNewVersion: true
  sendAnonymousUsage: false
entryPoints:
  http:
    address: :80
  https:
    address: :443

providers:
  docker:
    exposedByDefault: false
      #    endpoint: 'tcp://127.0.0.1:2375'
    endpoint: 'unix:///var/run/docker.sock'
    network: traefik-service
traefik-1  | 2024-08-18T07:05:16Z ERR Failed to retrieve information of the docker client and server host error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" providerName=docker
traefik-1  | 2024-08-18T07:05:16Z ERR Provider error, retrying in 697.634873ms error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" providerName=docker
traefik-1  | 2024-08-18T07:03:45Z ERR Failed to retrieve information of the docker client and server host error="Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running?" providerName=docker
traefik-1  | 2024-08-18T07:03:45Z ERR Provider error, retrying in 611.148557ms error="Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running?" providerName=docker

This line is missing in the second version of your docker-compose.yaml. That's why the socket connection fails.

Docker is not exposing the socket on 127.0.0.1:2375 by default (for security reasons). This is why the other configuration was failing as well.

Thank you it is working now.
I tested it wrongly