
version: '3'

services:
  node-red:
    image: nodered/node-red:3.1.6

    #  image: nodered/node-red-dev:3.0.0-beta.4-14
    container_name: "node-red"
    logging:
      driver: "json-file"
      options:
        max-size: "5m"
        max-file: "3"
    networks:
      - backend
    environment:
      - TZ=${TZ}
    ports:
      - "1881:1880"
    #devices:
        #- /dev/ttyAMA0
    restart: unless-stopped
    user: ${UID}
    volumes:
      - ${DIR}/nodered:/data
    labels:
      - diun.enable=true
      - "traefik.enable=true"
      - "traefik.http.services.node-red-service.loadbalancer.server.port=1880"
      - "traefik.http.routers.node-red-secure.entrypoints=web-secure"
      - "traefik.http.routers.node-red-secure.rule=Host(`nodered.${DOMAIN}`)"
      - "traefik.http.routers.node-red-secure.tls.certresolver=milvert_dns"
      - "traefik.http.routers.node-red-secure.tls=true"

  landet_domo:
    container_name: "landet_domo"
    image: ghcr.io/linuxserver/domoticz
    logging:
      driver: "json-file"
      options:
        max-size: "5m"
        max-file: "3"
    restart: unless-stopped
    networks:
      - backend
    volumes:
      - ${DIR}/landet/domo:/config
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "8002:8080"
    environment:
      - TZ=${TZ}
      - PUID=${UID}
      - PGID=${GID}
    labels:
      - "traefik.enable=false"
      - "traefik.http.services.landet_domo-service.loadbalancer.server.port=8080"
      - "traefik.http.routers.landet_domo-secure.entrypoints=web-secure"
      - "traefik.http.routers.landet_domo-secure.rule=Host(`landet_old.${DOMAIN}`)"
      - "traefik.http.routers.landet_domo-secure.tls.certresolver=milvert_dns"
      - "traefik.http.routers.landet_domo-secure.tls=true"

  huawei_inverter:
    image: huawei_inverter:1.0
    build: ../Inverter_huawei
    container_name: huawei_inverter
    dns:
      - 10.0.0.201
    logging:
      driver: "json-file"
      options:
        max-size: "5m"
        max-file: "3"
    networks:
      - backend
    restart: unless-stopped
    environment:
      - INVERTER_HOST=10.0.2.20
      - MQTT_HOST=mqtt
      - USE_CREDENTIALS=YES
      - USER_NAME=simon
      - PASSWORD=bajsa123
      - LOGLEVEL=INFO
      - MQTT_TOPIC=inverter
      - DATA_MODE=INVERTER # INVERTER or OFFLINE


networks:
  frontend:
    external: true
  backend:
    external: false

