Merge pull request #2972 from AxelPAL/nats

Add NATS messaging system
This commit is contained in:
Shao Yu-Lung (Allen) 2021-06-11 16:34:24 +08:00 committed by GitHub
commit dd596be437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 0 deletions

View File

@ -1003,3 +1003,8 @@ ELK_VERSION=7.9.1
### Tarantool ##################################################
TARANTOOL_PORT=3301
TARANTOOL_ADMIN_PORT=8002
### NATS ##################################################
NATS_CLIENT_PORT=4222
NATS_MONITORING_PORT=6222
NATS_ROUTE_PORT=8222

View File

@ -612,6 +612,15 @@ services:
image: 'neo4j:latest'
networks:
- backend
### Nats ################################################
nats:
build: ./nats
ports:
- "${NATS_CLIENT_PORT}:4222"
- "${NATS_MONITORING_PORT}:6222"
- "${NATS_ROUTE_PORT}:8222"
networks:
- backend
### MongoDB ##############################################
mongo:

5
nats/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM nats:latest
LABEL maintainer="Alexander Palchikov <axelpal@gmail.com>"
COPY nats-server.conf /etc/nats/nats-server.conf

25
nats/nats-server.conf Normal file
View File

@ -0,0 +1,25 @@
# Client port of 4222 on all interfaces
port: 4222
# HTTP monitoring port
monitor_port: 8222
# This is for clustering multiple servers together.
cluster {
# Route connections to be received on any interface on port 6222
port: 6222
# Routes are protected, so need to use them with --routes flag
# e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
authorization {
user: ruser
password: T0pS3cr3t
timeout: 2
}
# Routes are actively solicited and connected to from this server.
# This Docker image has none by default, but you can pass a
# flag to the gnatsd docker image to create one to an existing server.
routes = []
}