docker-compose.yml
version: "3.5"
services:
  nodered:
    container_name: nodered
    image: nodered/node-red:latest
    ports:
    - "1880:1880/tcp"
    volumes:
      - ./node-red:/data
    restart: unless-stopped
    networks:
      - proxy
    user: 0:0
    #network_mode: host
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nodered.rule=Host(`nr.example.com`)"
      - "traefik.http.routers.nodered.entrypoints=websecure"
      - "traefik.http.routers.nodered.tls.certresolver=myresolver"
      #- "traefik.http.services.nodered.loadbalancer.server.port=1880"
      - "traefik.http.routers.nodered.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=user1:pwdhash1,user2:pwdhash2"
      
networks:
  proxy:
    external: true