Sign inSign up

clevyr/laravel-echo-server

By clevyr

Updated about 4 years ago

Image
0

6.2K

clevyr/laravel-echo-server repository overview

docker-laravel-echo-server

Node Docker container with tlaverdure/laravel-echo-server installed. All of the laravel-echo-server environment variables are usable.

Installation

  1. Add this container to your docker-compose.yml with the following service definition.
echo-server:
  image: ghcr.io/clevyr/laravel-echo-server
  restart: unless-stopped
  1. If you are using clevyr/docker-caddy, configure the /socket.io route by adding the following env to the proxy service.
proxy:
  image: ghcr.io/clevyr/caddy
  environment:
    SOCKETIO_ADDRESS: echo-server:6001
  1. Install the client libraries
npm install laravel-echo socket.io-client
  1. Add the following snippet to resources/js/bootstrap.js.
import Echo from 'laravel-echo';

window.io = require('socket.io-client');

window.Echo = new Echo({
  broadcaster: 'socket.io',
  host: window.location.hostname,
});
  1. Follow the Laravel Broadcasting documentation to set up and subscribe to a channel.

Environment Variables

Refer to the DotEnv section of tlaverdure/laravel-echo-server for an environment variable listing.

Tag summary

Content type

Image

Digest

sha256:072097805

Size

49.6 MB

Last updated

about 4 years ago

docker pull clevyr/laravel-echo-server