├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE.md ├── README.md ├── docker-compose.yml └── package.json /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | Dockerfile 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:7.4 2 | 3 | WORKDIR /app 4 | COPY package.json /app 5 | RUN npm install 6 | EXPOSE 6001 7 | 8 | ENTRYPOINT ["/app/node_modules/.bin/laravel-echo-server"] 9 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Kyle Stevenson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # laravel-echo-server-docker 2 | 3 | Unofficial Dockerfile for the NPM package [laravel-echo-server](https://www.npmjs.com/package/laravel-echo-server). 4 | 5 | ## Configuration 6 | 7 | Currently the Dockerfile expects a `laravel-echo-server.json` file mounted 8 | onto the running container at the path: `/app/laravel-echo-server.json`. 9 | 10 | To interactively generate a config file you can run the following command: 11 | 12 | ``` 13 | docker run -p 6001:6001 \ 14 | -v /absolute/path/to/your/config.json:/app/laravel-echo-server.json \ 15 | -i kylestev/laravel-echo-server:latest init 16 | ``` 17 | 18 | Details about the options available in the configuration file can be found 19 | on GitHub: [tlaverdure/Laravel-Echo-Server#configurable-options](https://github.com/tlaverdure/Laravel-Echo-Server#configurable-options). 20 | 21 | ## Running a container 22 | 23 | Run the container with the standard laravel-echo-server port of `6001` exposed 24 | from the echo-server instance running inside the container. 25 | 26 | ``` 27 | docker run -p 6001:6001 \ 28 | -v /absolute/path/to/your/config.json:/app/laravel-echo-server.json:ro \ 29 | -i kylestev/laravel-echo-server:latest start 30 | ``` 31 | 32 | The `:ro` suffix on the volume flag (`-v`) specifies that the volume 33 | (file in our case) will be read-only. If you do not wish to mount the config 34 | file from the container's host machine (i.e. in production) you may want to 35 | investigate the following: 36 | 37 | - Create a volume to mount in place of the host machine volume mount 38 | - Create a container with your configuration file in it and mount it 39 | 40 | # Security 41 | 42 | Make sure not to store your `laravel-echo-server.json` in a public GitHub repo. 43 | 44 | If you have found a security related bug with the Dockerfile images produced by 45 | this repository please send me an email kyle@kylestevenson.me before posting it 46 | on the issue tracker. 47 | 48 | 49 | ## Todo 50 | 51 | - [ ] Finish this README 52 | - [ ] Change the expected config volume to be a directory instead of a file 53 | - [ ] Update Dockerfile entrypoint to be `laravel-echo-server` script 54 | - [ ] `node:x-ONBUILD` image base builds for easier 55 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | redis: 5 | container_name: 'redis' 6 | image: 'redis:3.2.6-alpine' 7 | 8 | laravel-echo: 9 | image: 'kylestev/laravel-echo-server:1.2.1' 10 | container_name: 'laravel-echo-server' 11 | ports: 12 | - '6001:6001' 13 | links: 14 | - 'redis:redis' 15 | volumes: 16 | - /Users/kylestev/dd/laravel-echo-server.json:/app/laravel-echo-server.json:ro 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel-echo-server-docker", 3 | "description": "Docker container for running laravel-echo-server", 4 | "version": "0.0.1", 5 | "license": "MIT", 6 | "dependencies": { 7 | "laravel-echo-server": "^1.2.1" 8 | }, 9 | "scripts": { 10 | "start": "laravel-echo-server start" 11 | } 12 | } --------------------------------------------------------------------------------