Websocket using official docker image and nginx

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SkylerK-GG
    Junior Member
    • Nov 2025
    • 1

    #1

    Websocket using official docker image and nginx

    Hello all,

    I have inherited a mostly set up and in use espo instance at my company, and am attempting to get websockets working on it. The compose.yml is based on the one on the page for the official docker espo image, with the addition of a phpmyadmin container, as follows:

    Code:
    services:
    
      espocrm-db:
        image: mariadb:latest
        container_name: espocrm-db
        environment:
          MARIADB_ROOT_PASSWORD: [REDACTED]
          MARIADB_DATABASE: espocrm
          MARIADB_USER: espocrm
          MARIADB_PASSWORD: [REDACTED]
        volumes:
          - espocrm-db:/var/lib/mysql
        restart: always
        healthcheck:
          test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
          interval: 20s
          start_period: 10s
          timeout: 10s
          retries: 3
        ports:
          - 8956:3306
    
      espocrm:
        image: espocrm/espocrm
        container_name: espocrm
        environment:
          ESPOCRM_DATABASE_PLATFORM: Mysql
          ESPOCRM_DATABASE_HOST: espocrm-db
          ESPOCRM_DATABASE_USER: espocrm
          ESPOCRM_DATABASE_PASSWORD: [REDACTED]
          ESPOCRM_ADMIN_USERNAME: admin
          ESPOCRM_ADMIN_PASSWORD: [REDACTED]
          ESPOCRM_SITE_URL: "https://espo.[COMPANYSITE].com"
        volumes:
          - espocrm:/var/www/html
        restart: always
        depends_on:
          espocrm-db:
            condition: service_healthy
        ports:
          - 8888:80
    
      espocrm-phpmyadmin:
        image: phpmyadmin/phpmyadmin
        container_name: espocrm-phpmyadmin
        links:
          - espocrm-db
        environment:
          PMA_HOST: espocrm-db
          PMA_PORT: 3306
          PMA_ARBITRARY: 1
        restart: always
        ports:
          - 8583:80
    
    
      espocrm-daemon:
        image: espocrm/espocrm
        container_name: espocrm-daemon
        volumes:
          - espocrm:/var/www/html
        restart: always
        entrypoint: docker-daemon.sh
    
      espocrm-websocket:
        image: espocrm/espocrm
        container_name: espocrm-websocket
        environment:
          ESPOCRM_CONFIG_USE_WEB_SOCKET: "true"
          ESPOCRM_CONFIG_WEB_SOCKET_URL: "wss://espo.[COMPANYSITE].com:8081"
          ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN: "tcp://*:7777"
          ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN: "tcp://espocrm-websocket:7777"
        volumes:
          - espocrm:/var/www/html
        restart: always
        entrypoint: docker-websocket.sh
        ports:
          - 8081:8080
    
    
    
    
    volumes:
      espocrm-db:
      espocrm:
    There is also an Nginx Proxy Manager instance, which has separate proxy hosts defined for the espo application and the websocket connection.

    The error I'm getting in the web console for the websockets is this:

    Code:
    autobahn.js:341WebSocket connection to 'wss://espo.[COMPANYSITE].com:8081/?authToken=e0e4afb…&userId=682dff6b85b8b6ef6' failed:
      ab.Session @ autobahn.js:341
    Which, when clicked provides the following additional info:
    Code:
    Could not load content for https://espo.[COMPANYSITE].com/client/lib/original/autobahn.js (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
    I'm at the very edge of my depth here, and I'm not sure what all information might be needed to figure this one out. Please let me know what else might be needed.
Working...