version: "3.3" services: traefik: image: traefik:v2.4 restart: always ports: - "80:80" - "443:443" networks: - web - dockersocket volumes: - "$PWD/traefik.yml:/etc/traefik/traefik.yml" - "$PWD/extraProviders/:/extraProviders:ro" labels: - "traefik.enable=true" - "traefik.http.routers.traefik.rule=Host(`traefik.${HOSTNAME}`)" - "traefik.http.routers.traefik.entrypoints=web" - "traefik.http.services.traefik.loadbalancer.server.port=8080" - "docker.group=proxy" extra_hosts: - host.docker.internal:172.17.0.1 depends_on: - docker-socket-proxy docker-socket-proxy: image: tecnativa/docker-socket-proxy restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: # grant privileges as environment variables: https://github.com/Tecnativa/docker-socket-proxy#grant-or-revoke-access-to-certain-api-sections - CONTAINERS=1 - INFO=1 networks: - dockersocket privileged: true whoami: image: containous/whoami networks: - web labels: - "traefik.enable=true" - "traefik.http.routers.whoami.rule=Host(`whoami.${HOSTNAME}`)" - "traefik.http.routers.whoami.entrypoints=web" - "traefik.http.services.whoami.loadbalancer.server.port=80" - "docker.group=proxy" restart: unless-stopped networks: web: external: true dockersocket: external: true