Docker compose Installation - Server nicht erreichbar

Nach der Installation mittels Docker compose (https://hub.docker.com/r/openems/edge und Aufruf der localhost:80 UI Seite erscheint die Fehlermeldung “Server nicht erreichbar”.

Was kann ich hier tun?

Hi,

es wäre toll, wenn du diesen Thread unter deinem anderen gestellt hättest.

Was hast du denn in deiner nginx config stehen?

Grüße

Sorry, werde ich kommendes Mal machen.

In der nginx.conf unter /etc/nginx ist nur folgender Eintrag:
include /etc/nginx/openems-nginx.conf;

Viele Grüße, Max

Ich bin rin Freund von “nicht alles aus der Nase ziehen lassen”

Was steht denn in der:

? :slight_smile:

Grüße

Ich hatte die openems-nginx.conf nicht verändert. Nachfolgend der content.
Grüße, Max

# /etc/nginx/openems-nginx.conf
# Based on alpine defaults
# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.conf?h=3.15-stable

user abc;

# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto;

# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

# Configures default error logger.
error_log /var/log/nginx/error.log warn;

# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;

# Include files with config snippets into the root context.
include /etc/nginx/conf.d/*.conf;

events {
    # The maximum number of simultaneous connections that can be opened by
    # a worker process.
    worker_connections 1024;
}

http {
    # Includes mapping of file name extensions to MIME types of responses
    # and defines the default type.                                         
    include /etc/nginx/mime.types;                                          
    default_type application/octet-stream;                                 
                                                                              
    # Don't tell nginx version to the clients. Default is 'on'.               
    server_tokens off;                                                   
                                                           
    # Specifies the maximum accepted body size of a client request, as     
    # indicated by the request header Content-Length. If the stated content
    # length is greater than this size, then the client receives the HTTP
    # error code 413. Set to 0 to disable. Default is '1m'.               
    client_max_body_size 0;                                                
                                                           
    # Sendfile copies data between one FD and other from within the kernel,
    # which is more efficient than read() + write(). Default is off.       
    sendfile on;                                                         
                                                                          
    # Causes nginx to attempt to send its HTTP response head in one packet,
    # instead of using partial frames. Default is 'off'.              
    tcp_nopush on;                                                         
                                                                         
    # all ssl related config moved to ssl.conf                              
    # included in server blocks where listen 443 is defined

    # Enable gzipping of responses.                            
    #gzip on;                                                              
                                                                            
    # Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
    gzip_vary on;                                                          
                                                                              
    # Helper variable for proxying websockets.                                
    map $http_upgrade $connection_upgrade {                                
        default upgrade;                                   
        '' close;                                                          
    }                                                                      
                                                                            
    # Specifies the main log format.                                      
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
            '$status $body_bytes_sent "$http_referer" '    
            '"$http_user_agent" "$http_x_forwarded_for"';                  
                                                                           
    # Sets the path, format, and configuration for a buffered log write.    
    access_log /var/log/nginx/access.log main;                            
                                                                           
    # Includes virtual hosts configs.                                 
    include /etc/nginx/site-confs/*.conf;                                  
}                                                                        
                                                                            
daemon off;                                                              
pid /run/nginx.pid;

Das Problem liegt vermutlich daran das der Websocket nicht richtig funktioniert. Ich habe aktuell das selbe Problem

Gibt es Möglichkeiten dem Problem auf die Spur zu gehen und zu beheben? Ich habe beim Docker Compose file nichts verändert.

Wollte mich hier nur anschliesen. Habe das selbe Problem.

Hallo,

ich hatte das gleiche Problem, da ich zunächst zwei separate docker-compose Files genutzt habe. Um ein gemeinsames Netzwerk für die Container zu bekommen sollten alle Services in einem Docker Compose File enthalten sein oder ein übergreifendes Netzwerk definiert werden:

Hier mein aktuelles docker-compose.yaml

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

  openems_backend:
    image: openems/backend:latest
    container_name: openems_backend
    hostname: openems_backend
    restart: unless-stopped
    volumes:
      - openems-backend-conf:/opt/openems/config:rw
      - openems-backend-data:/opt/openems/data:rw
    ports:
      - 8079:8079 # Apache-Felix
      - 8081:8081 # Edge-Websocket
      - 8082:8082 # UI-Websocket

  openems-ui:
    image: openems/ui-backend: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://homeserver:8082 # Change to your actual hostname or ip
    ports:
      - 80:80
      - 443:443

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


Die Edge Konfiguration über Felix kann ich vornehmen und sehe die erwarteten Parameter.
Allerdings sehe ich im Frontend dann zwei Edge Instanzen, die beide offline sind.

Viele Grüße
Dirk

Hallo,
nach Herausnahme des BE sehe ich im Frontend auch das UI:

Hier das zugehörige docker-compose.yaml:

services:
  openems-edge:
    image: openems/edge:latest
    container_name: openems_edge
    hostname: openems_edge
    restart: unless-stopped
    volumes:
      - openems-edge-conf:/opt/openems/config:rw
      - openems-edge-data:/opt/openems/data:rw
    ports:
      - 8080:8080 # Apache-Felix
      - 8085:8085 # Controller.Api.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://homeserver:8085 # Change to your actual hostname or ip
    ports:
      - 80:80
      - 443:443

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

ChatGPT ist manchmal hilfreich :stuck_out_tongue:

I don’t get your point, Sn0w3y.

My actual hostname is “homeserver” and used in the environment variable of the first try with separate docker-compose files and results in exactly the same error “server not accessible” as mentioned in the beginning of this thread by mgrosse.

When I have put everything into one docker-compose file, I have received the message “device not connected” as shown in my first post - at least one stet forward from the initial state.

In the latter setup without BE this environment setting is not required and the connection obviously works.

Kind regards
Dirk

Na, ich dachte es funktioniert mit der .yaml File, die du hier gepostet hast jetzt?

Ja, das letzte docker-compose.yaml funktioniert, wie im Screenshot sichtbar.
Ich habe nur Deinen Kommentar nicht verstanden.