Browse Source

Merge pull request #2815 from noud/mercure

Mercure for Server-sent events
Shao Yu-Lung (Allen) 4 years ago
parent
commit
4cf39da90d
4 changed files with 33 additions and 0 deletions
  1. 1 0
      DOCUMENTATION/content/introduction/index.md
  2. 18 0
      docker-compose.yml
  3. 9 0
      env-example
  4. 5 0
      mercure/Dockerfile

+ 1 - 0
DOCUMENTATION/content/introduction/index.md

@@ -192,6 +192,7 @@ That's it! enjoy :)
     - PostGIS *(Database extender for PostgreSQL. It adds support for geographic objects allowing location queries to be run in SQL)*
     - Blackfire *(Empowers all PHP developers and IT/Ops to continuously verify and improve their app's performance)*
     - Laravel Echo *(Bring the power of WebSockets to your Laravel applications)*
+    - Mercure *(Server-sent events)*
     - Phalcon *(A PHP web framework based on the model–view–controller pattern)*
     - Minio *(Cloud storage server released under Apache License v2, compatible with Amazon S3)*
     - AWS EB CLI *(CLI that helps you deploy and manage your AWS Elastic Beanstalk applications and environments)*

+ 18 - 0
docker-compose.yml

@@ -744,6 +744,24 @@ services:
       networks:
         - backend
 
+### Mercure #############################################
+    mercure:
+      build: ./mercure
+      ports:
+        - "${MERCURE_NODE_HOST_HTTP_PORT}:80"
+        - "${MERCURE_NODE_HOST_HTTPS_PORT}:443"
+      privileged: true
+      environment:
+        - MERCURE_PUBLISHER_JWT_KEY=${MERCURE_PUBLISHER_JWT_KEY}
+        - MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_SUBSCRIBER_JWT_KEY}
+        - DEBUG=${MERCURE_DEBUG}
+        - SERVER_NAME=${MERCURE_SERVER_NAME}
+        - MERCURE_EXTRA_DIRECTIVES=cors_allowed_origins *\npublish_allowed_origins http://localhost:${MERCURE_NODE_HOST_HTTP_PORT} https://localhost:${MERCURE_NODE_HOST_HTTP_PORT}
+      hostname: laradock-mercure
+      networks:
+        - frontend
+        - backend
+
 ### Cassandra ############################################
     cassandra:
       build: ./cassandra

+ 9 - 0
env-example

@@ -414,6 +414,15 @@ RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT=15671
 RABBITMQ_DEFAULT_USER=guest
 RABBITMQ_DEFAULT_PASS=guest
 
+### MERCURE ##############################################
+
+MERCURE_NODE_HOST_HTTP_PORT=1337
+MERCURE_NODE_HOST_HTTPS_PORT=1338
+MERCURE_PUBLISHER_JWT_KEY=secret
+MERCURE_SUBSCRIBER_JWT_KEY=another_secret
+MERCURE_DEBUG=debug
+MERCURE_SERVER_NAME=:80
+
 ### MEILISEARCH ###########################################
 
 MEILISEARCH_HOST_PORT=7700

+ 5 - 0
mercure/Dockerfile

@@ -0,0 +1,5 @@
+FROM dunglas/mercure
+
+LABEL maintainer="Kévin Dunglas <kevin@dunglas.fr>"
+
+EXPOSE 80 443