Port is missing docker swarm

Hello there,

first of all hi!
This is my first post here and I hope I make it right. I tried to fix this odd issue now for more than 3h and nothing, I searched online and even here. I found people that had the same problem and I tried the fix people provided, but still nothing.

So maybe someone can help me here.

This is my traefik docker stack file
version: "3"
services:
  traefik:
    image: traefik:2.0.0
    command:
      # defines all entryPoints
      - --entryPoints.web.address=:80
      - --entryPoints.websecure.address=:443
      - --entryPoints.minecraft.address=:25565

      # https/ssl certificat settings
      # - --certificatesResolvers.sample.acme.email="no-reply@fenpa.ws"
      # - --certificatesResolvers.sample.acme.storage="acme.json"

      # used during the challenge
      # - --certificatesResolvers.sample.acme.httpChallenge.entryPoint=web

      # file provider for manuel config
      - --providers.file.filename=/etc/traefik/dynamic_conf.toml
      - --providers.file.watch=true

      # enabled docker provide
      - --providers.docker
      - --providers.docker.swarmMode=true
      - --providers.docker.watch=true

      # api on http
      - --api.insecure=true

      # mettics for Prometheus
      - --metrics.prometheus=true
      - --metrics.prometheus.buckets=0.100000, 0.300000, 1.200000, 5.000000
    environment:
      - TZ=Europe/Berlin
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - traefic_vol:/etc/traefik/acme
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/docker/dynamic_conf.toml:/etc/traefik/dynamic_conf.toml
    networks:
      - traefik-net
    deploy:
      mode: global
      placement:
        constraints:
          - node.role == manager
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
volumes:
  traefic_vol:
networks:
  traefik-net:
    external: true
  monitor-net:
    external: true
this is my prometheus docker stack file
version: "3"
services:
  prometheus:
    image: prom/prometheus
    labels:
      - traefik.enable=true
      - traefik.http.routers.prometheus.rule=Host(`prometheus.localhost`)
      - traefik.http.routers.prometheus.entrypoints=web
      - traefik.http.routers.prometheus.service=prometheus-backend
      - traefik.http.services.prometheus-backend.loadbalancer.server.port=9090 
    environment:
      - TZ=Europe/Berlin
    networks: 
      - monitor-net
      - traefik-net
    deploy:
      mode: global
      placement:
        constraints:
          - node.role == manager
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
    volumes:
      - /home/docker/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
  traefik-net:
    external: true
  monitor-net:
    external: true

i try to get this working but everytime I get the error

level=error msg="port is missing" providerName=docker container=monitoring_prometheus-qec5jl2ef63ly1kbo2k9cuibr

what am I doing wrong? idont have any ideas anymore

Duplicate of:

Already tried these but thanks, if i missed something please tell me

In swarm mode, the labels must be placed inside the deploy section.

Thank you, i try this out today and repot if this worked.