[v2.0-alpha7] docker swarm provider - "port is missing"

I am struggling with getting docker provider simple HTTP app working.

Traefik container log show "error" with message "port is missing".

Bellow are my configs:

Traefik compose file:

version: "3.7"

services:
  traefik:
    image: traefik:v2.0
    ports:
      - "80:80"
      - "8080:8080"
      - "443:443"
    networks:
      - web
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/traefik/traefik.yaml:/etc/traefik/traefik.yaml
      - /opt/traefik/acme.json:/opt/traefik/acme.json

networks:
  web:
    external: true

traefik.yaml:

global:
  sendAnonymousUsage: false
log:
  level: "DEBUG"
providers:
  docker:
    swarmMode: true
    watch: true
    exposedByDefault: false

api:
  dashboard: true

entryPoints:
  web:
    address: ":80"
  web-secure:
    address: ":443"

acme:
  email: "xxx@yyy.zz"
  storage: /opt/traefik/acme.json
  onHostRule: true
  httpChallenge:
    entryPoint: web

app compose file:

version: "3.7"
services:
  app_staging:
    image: 192.168.64.148:5000/appimg:latest
    environment:
      - ASPNETCORE_ENVIRONMENT=Staging
      - CONFIG_FILE=/run/secrets/staging.config
    networks:
      - web
    secrets:
      - staging.config
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.port=80"
        - "traefik.http.routers.app_test.rule=Host(`test.app.com`)"
        - "traefik.docker.network=web"
      update_config:
        order: start-first

secrets:
  staging.config:
    file: ./staging.config

networks:
  web:
    external: true
    name: web

Hello,

It's a v1 label, for the v2 you have to use:

"traefik.http.services.service0.loadbalancer.server.port=80"

Oh I see, gonna try that. But is that a required label? Didn't notice any such in the v2 docs about Docker provier.

It's not required, it's depend how your image is define: if your image define a port Traefik will use that port.

And how would such a port definition need to be done? I was trying to set ports for the service docker compose, but that didn't work either.

Edit:

I tried:

 ports:
  - 80

That didnt work

And:

expose:
 - 80

Which doesn't work for docker, as its deprecated option -

expose: Exposing ports is unnecessary - services on the same network can access each other's containers on any port.

Edit 2:

I also tried adding EXPOSE 80 to dockerfile, but that didn't help either.

traefik.http.services.[whatever].loadbalancer.server.port=80

Kind of annoying that the shortcuts we used to have no longer exist and we have to name everything. In addition I think these names have to be unique across the swarm

Yes, learned hard way. If not unique, it starts mixing the services when routing requests.

Seems V2 is quite flakey out the gate, hopefully things drastically change before it gets GA