Sign inSign up

sunasteriskrnd/laravel-echo-server

By sunasteriskrnd

Updated almost 5 years ago

Laravel echo server

Image
0

3.0K

sunasteriskrnd/laravel-echo-server repository overview

docker-laravel-echo-server

Docker image for Laravel Echo server.

Usage

Pull the image

docker pull sunasteriskrnd/laravel-echo-server

Start a container

docker run -e REDIS_HOST=<redis server host> sunasteriskrnd/laravel-echo-server
Environment variables

You must set the AUTH_HOST environment variable if you want to use private or presence channels.

REDIS_HOST is required when you enable Redis subscriber (yes by default) or you use Redis for as database to store presence channels data (yes by default).

See below for a full list of environment variables.

API Client

If you want to use the HTTP subscriber, you must create an API client. You can mount a laravel-echo-server.json file into the container and run the client:add command to create an one.

docker run -v <your laravel-echo-server.json>:/laravel-echo-server/laravel-echo-server.json \
    sunasteriskrnd/laravel-echo-server laravel-echo-server client:add

You can see your created client ID and Key by viewing your file. Note that your file must be a valid JSON file. You can create an empty one with.

echo "{}" > laravel-echo-server.json
SQLite

If you want to use SQLite as your database to store presence channels data, mount an SQLite DB file in the path you chose for SQLITE_DB_PATH (default is /database/laravel-echo-server.sqlite).

docker run -v <your sqlite db file>:/database/laravel-echo-server.sqlite \
    -e DATABASE=sqlite \
    sunasteriskrnd/laravel-echo-server

Configuration

The image is configurable via environment variables.

VariableDefaultDerscription
AUTH_HOSTThe host of the server that authenticates private and presence channels
AUTH_ENDPOINT/broadcasting/authThe route that authenticates private channels
ENABLE_HTTPtrueEnable HTTP subscriber
ENABLE_REDIStrueEnable Redis subscriber
DATABASEredisDatabase used to store presence channels data
REDIS_HOSTRedis server host
REDIS_PORT6379Redis server port
REDIS_PASSWORDRedis server password
REDIS_KEY_PREFIX''Prefix for Redis keys. Should match your Laravel app's Redis config
SQLITE_DB_PATH/database/laravel-echo-server.sqliteSQLite database path
ALLOW_CORSfalseAllow CORS
ALLOW_ORIGIN''Access-Control-Allow-Origin Header
ALLOW_METHODS''Access-Control-Allow-Methods Header
ALLOW_HEADERS''Access-Control-Allow-Headers Header
DEV_MODEfalseAdds additional logging for development purposes

Tag summary

Content type

Image

Digest

Size

68 MB

Last updated

almost 5 years ago

docker pull sunasteriskrnd/laravel-echo-server