I want to expose some routers of a container to the internet, but allow then on a different route (and port) on the local network. Only $TRAEFIKPORT, used for websecure is exposed on the router firewall.
Is there any way to do it?
Error message:
2025-05-17T15:57:42Z ERR Router passwords-api cannot be linked automatically with multiple Services: ["passwords-api" "passwords"] providerName=docker routerName=passwords-api
2025-05-17T15:57:42Z ERR Router passwords cannot be linked automatically with multiple Services: ["passwords-api" "passwords"] providerName=docker routerName=passwords
passwords:
image: vaultwarden/server:latest
container_name: passwords
networks:
- lab
restart: unless-stopped
user: "${UID}:${GID}"
env_file:
- default.env
environment:
- DOMAIN=https://pass.${DOMAIN}:${TRAEFIKPORT}
- SIGNUPS_ALLOWED=false
# - ADMIN_TOKEN=${VAULTWARDEN_ADMIN_TOKEN}
# - DISABLE_ADMIN_TOKEN=true
# ports:
# - 80:80
volumes:
- $CONFIG/passwords/:/data/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.passwords.rule=Host(`pass.${DOMAIN}`)"
- "traefik.http.routers.passwords.entrypoints=localonly"
- "traefik.http.routers.passwords.tls.certresolver=myresolver"
- "traefik.http.services.passwords.loadbalancer.server.port=80"
- "traefik.http.routers.passwords-api.rule=Host(`pass.${DOMAIN}`) && PathRegexp(`(^/api.*)|(^/identity.*)|(^/#/send.*)|(^/notifications.*)|(^/images.*)|(^.*\\.json)|(^/icons.*)`)" # https://www.reddit.com/r/selfhosted/comments/1knli8i/comment/msmhhy2/?context=3
- "traefik.http.routers.passwords-api.entrypoints=websecure"
- "traefik.http.routers.passwords-api.tls.certresolver=myresolver"
- "traefik.http.services.passwords-api.loadbalancer.server.port=80"
- docker-volume-backup.stop-during-backup=backup