Skip to content

Repository of oanhnn/laravel-echo-server Docker image.

License

Notifications You must be signed in to change notification settings

oanhnn/docker-laravel-echo-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oanhnn/laravel-echo-server

NOTE: I announce that I will no longer be developing for this project. Because I switched to using Soketi for my projects. The reason is that laravel-echo-server seems to have stopped active development. Soketi is a very good opensource, Pusher alternative and still active development project.

Alpine based Laravel Echo Server image.

Tiếng Việt

Build Status Software License

Features

  • Build from official NodeJS docker image
  • Install latest laravel-echo-server
  • Tagging follow semantic version
  • Auto generate config file
  • Auto build and push by Github Workflow

Tags

Image oanhnn/laravel-echo-server

  • X.Y.Z - the PATH version (git tag vX.Y.Z)
  • X.Y - the MINOR version
  • X - the MAJOR version
  • latest - the latest version

Image ghcr.io/oanhnn/laravel-echo-server

  • edge - the edge version, it is the newest code from branch master
  • nightly - the nightly version, it is built daily at 8:20 AM UTC

NOTE: Using sematic version for production

Requirement

  • Docker Engine 1.13+

Usage

Run laravel-echo-server

Run laravel-echo-server by command

$ docker run -d -p 6001:6001 -v $(pwd):/app oanhnn/laravel-echo-server

Run laravel-echo-server sub-commands

$ docker run --rm -it -v $(pwd):/app oanhnn/laravel-echo-server init
$ docker run --rm -it -v $(pwd):/app oanhnn/laravel-echo-server start
$ docker run --rm -it -v $(pwd):/app oanhnn/laravel-echo-server client:add
$ docker run --rm -it -v $(pwd):/app oanhnn/laravel-echo-server client:remove

Run with docker-compose

See some examples in examples folder.

Auto generate config file

  • If /app/laravel-echo-server.json exists, it will be loaded

  • If /app/laravel-echo-server.json not exists, it will be generated from default configs with laravel-echo-server.

  • If /app/laravel-echo-server.json not exists, and you want, it will be generated by another process, please set environment variable LARAVEL_ECHO_SERVER_GENERATE_CONFIG to false (default true).

    $ docker run -d -p 6001:6001 -v $(pwd):/app -e "LARAVEL_ECHO_SERVER_GENERATE_CONFIG=false" oanhnn/laravel-echo-server

Configure database

The database may be redis or sqlite.
It can be configured by environment variable LARAVEL_ECHO_SERVER_DB (default is redis).

  • By default, Redis database will be used. You can set Redis config by environment variables:

    "databaseConfig": {
      "redis": {
        "host": "REDIS_HOST",
        "port": "REDIS_PORT",
        "password": "REDIS_PASSWORD",
        "keyPrefix": "REDIS_PREFIX",
        "options": {
          "db": "REDIS_DB"
        }
      }
    },
    Environment variable Default value
    REDIS_HOST redis
    REDIS_PORT 6379
    REDIS_PASSWORD NULL
    REDIS_PREFIX laravel_database_
    REDIS_DB 0

NOTE: These environment variables use only when generate laravel-echo-server.json file. You can use environment variables to override config, please see next section.

  • You can use SQLite database by set environment variable LARAVEL_ECHO_SERVER_DB to sqlite. The SQLite file will store in /app/database/

    $ docker run -d -p 6001:6001 -v $(pwd):/app -e "LARAVEL_ECHO_SERVER_DB=sqlite" oanhnn/laravel-echo-server

Override config by environment variables

If some environment variables are existed (allow load /app/.env file is found), the following options can be overridden:

Environment variable Config key Note
LARAVEL_ECHO_SERVER_AUTH_HOST authHost This option will fall back to the LARAVEL_ECHO_SERVER_HOST option as the default if that is set.
LARAVEL_ECHO_SERVER_HOST host
LARAVEL_ECHO_SERVER_PORT port
LARAVEL_ECHO_CLIENT_APP_ID clients.0.appId optional: add first client with key LARAVEL_ECHO_CLIENT_APP_KEY
LARAVEL_ECHO_CLIENT_APP_KEY clients.0.key
LARAVEL_ECHO_SERVER_DEBUG devMode
LARAVEL_ECHO_SERVER_REDIS_HOST databaseConfig.redis.host
LARAVEL_ECHO_SERVER_REDIS_PORT databaseConfig.redis.port
LARAVEL_ECHO_SERVER_REDIS_PASSWORD databaseConfig.redis.password
LARAVEL_ECHO_SERVER_PROTO protocol
LARAVEL_ECHO_SERVER_SSL_KEY sslKeyPath
LARAVEL_ECHO_SERVER_SSL_CERT sslCertPath
LARAVEL_ECHO_SERVER_SSL_PASS sslPassphrase
LARAVEL_ECHO_SERVER_SSL_CHAIN sslCertChainPath

See more about environment variables in here

NOTE The entrypoint script only support partial for these environment variable overrides. Some environments will support by native laravel-echo-server. It is implemented by code and overrides laravel-echo-server.json See more

Contributing

All code contributions must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send a pull request.

If you would like to help take a look at the list of issues.

License

This project is released under the MIT License.
Copyright © 2021 Oanh Nguyen
Please see License File for more information.