tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 511 forks source link

Connection refused on docker #594

Closed cod3rshotout closed 2 years ago

cod3rshotout commented 2 years ago

I'm using Docker along with laravel-echo-server, so I have added this container to my docker-compose.yml file:

  laravel-echo-server:
    restart: always
    container_name: socialthess_laravel_echo_server
    build:
      context: .
      dockerfile: ./docker/laravel-echo/Dockerfile
    ports:
      - '6001:6001'
    working_dir: /usr/src/app
    volumes:
      - ./docker/laravel-echo/laravel-echo-server.json:/usr/src/app/laravel-echo-server.json
    links:
      - nginx
      - redis

This is the Dockerfile:

FROM node:latest AS node

RUN npm install -g laravel-echo-server

CMD ["start"]
ENTRYPOINT ["laravel-echo-server"]

So I tried to include the socket using:

<script src="//localhost:6001/socket.io/socket.io.js"></script>

But I get:

https://localhost:6001/socket.io/socket.io.js net::ERR_CONNECTION_REFUSED

I'm using this library https://github.com/evertramos/nginx-proxy-automation