Skip to content

Commit 0c7f5a2

Browse files
committedJun 4, 2021
nats messaging system
1 parent 3d57064 commit 0c7f5a2

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed
 

‎.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -1003,3 +1003,8 @@ ELK_VERSION=7.9.1
10031003
### Tarantool ##################################################
10041004
TARANTOOL_PORT=3301
10051005
TARANTOOL_ADMIN_PORT=8002
1006+
1007+
### NATS ##################################################
1008+
NATS_CLIENT_PORT=4222
1009+
NATS_MONITORING_PORT=6222
1010+
NATS_ROUTE_PORT=8222

‎docker-compose.yml

+9
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,15 @@ services:
612612
image: 'neo4j:latest'
613613
networks:
614614
- backend
615+
### Nats ################################################
616+
nats:
617+
build: ./nats
618+
ports:
619+
- "${NATS_CLIENT_PORT}:4222"
620+
- "${NATS_MONITORING_PORT}:6222"
621+
- "${NATS_ROUTE_PORT}:8222"
622+
networks:
623+
- backend
615624

616625
### MongoDB ##############################################
617626
mongo:

‎nats/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nats:latest
2+
3+
LABEL maintainer="Alexander Palchikov <axelpal@gmail.com>"
4+
5+
COPY nats-server.conf /etc/nats/nats-server.conf

‎nats/nats-server.conf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Client port of 4222 on all interfaces
2+
port: 4222
3+
4+
# HTTP monitoring port
5+
monitor_port: 8222
6+
7+
# This is for clustering multiple servers together.
8+
cluster {
9+
10+
# Route connections to be received on any interface on port 6222
11+
port: 6222
12+
13+
# Routes are protected, so need to use them with --routes flag
14+
# e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
15+
authorization {
16+
user: ruser
17+
password: T0pS3cr3t
18+
timeout: 2
19+
}
20+
21+
# Routes are actively solicited and connected to from this server.
22+
# This Docker image has none by default, but you can pass a
23+
# flag to the gnatsd docker image to create one to an existing server.
24+
routes = []
25+
}

0 commit comments

Comments
 (0)
Please sign in to comment.