Docker UI + Edge Deployment

Hei liebe Alle,

bin neu in dieser Community. Habe schon etwas mit dem EMS-Edge herumprobiert. Funktioniert super, echt geil gemacht. Nun wollte ich dabei auch noch das EMS-UI einbinden.

Habe aufgrund von der Einfachheit und da ich schon mehr Erfahrung mit Docker habe, alle Komponenten in Containern deployed.

Leider bekomme ich es gerade nicht gebacken das sich die UI auf den Websocket des Edge Verbindet. Bekomme immer den Fehler:

Lokalzugriff derzeit nicht möglich

Diesen sehe ich in der UI. Wenn ich aber überprüfe ob die Ports offen sind sieht alles gut aus:

nmap localhost
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-12 10:11 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00028s latency).
Not shown: 995 closed tcp ports (conn-refused)
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
8080/tcp open  http-proxy
8085/tcp open  unknown

In den Logs der Container sehe ich nur das der Websocket gestartet wurde, keine Verbindungsversuchte etc…

2025-02-12T10:08:33,115 [_cycle  ] INFO  [socket.AbstractWebsocketServer] [ctrlApiWebsocket0] Starting websocket server [port=8085]

Der Container der UI gibt nichts was mit helfen würde in die Logs:

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────────                               
 _____ _____ _____ _____ _____ _____ _____ 
|     |  _  |   __|   | |   __|     |   __|
|  |  |   __|   __| | | |   __| | | |__   |
|_____|__|  |_____|_|___|_____|_|_|_|_____|      

    Based on images from linuxserver.io    
───────────────────────────────────────────
for further information visit:
https://openems.io/

───────────────────────────────────────
GID/UID:    911/911
───────────────────────────────────────
using keys found in /etc/nginx/keys
[custom-init] No custom files found, skipping...

Hat jemand von euch eine Idee was ich hier ändern könnte, damit ich das UI verbinden kann.

Bin für jegliche Vorschläge/Hilfe bereit. Bitte schreiben, falls ich noch andere Logs/outputs posten soll.

Beste Grüße
BETON

ps: Habe das Forum schon etwas abgegrast aber nichts für mich zutreffendes gefunden. Gerne andere Threads verlinken. danke!!!

ps hier noch das docker-compose, dass ich gerade verwende:

version: "3"

services:
  openems-edge:
    image: openems/edge:latest
    container_name: openems_edge
    hostname: openems_edge
    restart: unless-stopped
    volumes:
      - openems-edge-conf:/var/opt/openems/config:rw
      - openems-edge-data:/var/opt/openems/data:rw
    ports:
      - 8080:8080 # Apache-Felix
      - 8085:8085 # UI-Websocket

  openems-ui:
    image: openems/ui-edge:latest
    container_name: openems_ui
    hostname: openems_ui
    restart: unless-stopped
    volumes:
      - openems-ui-conf:/etc/nginx:rw
      - openems-ui-log:/var/log/nginx:rw
    environment:
      - UI_WEBSOCKET=ws://localhost:8085
    ports:
      - 80:80
      - 443:443

volumes:
  openems-edge-conf:
  openems-edge-data:
  openems-ui-conf:
  openems-ui-log:

Hello,
for the UI container localhost refers to itself, not to the host machine. Try to remove the UI_WEBSOCKET environment variable and see if that works. As long as both the Edge and the UI containers are on the same host, it should work.

Regards,
Fabio

This issue arises since:

I resolved it by compiling the UI myself with Port 8085 and copied into the container - fixed !

Hi all,

thanks for your help. The issue was with the localhost in the websocket.

I changed setup then.
My main machine which is running the ui container and some others. The Edge is running on my other machine which sits next to my goodwe inverter. I put it there because i read somewhere, that the modbus RTU is working better than the modbus TCP.

All, in all. Thanks for the quick help.

Best regards
Beton