-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nats: add docker-compose and enable websocket
Signed-off-by: Victor Login <batazor111@gmail.com>
- Loading branch information
Showing
3 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '2.4' | ||
|
||
x-network: &network | ||
networks: | ||
- simple | ||
dns: | ||
- ${DNS_IP} | ||
dns_search: ${DNS_SEARCH} | ||
|
||
services: | ||
|
||
nats: | ||
<<: *network | ||
depends_on: | ||
- coredns | ||
image: nats:2.9-alpine | ||
entrypoint: "/gnatsd -DV" | ||
hostname: nats-server | ||
container_name: nats | ||
restart: on-failure | ||
ports: | ||
- '4222:4222' | ||
- '8080:8080' # websocket | ||
volumes: | ||
- ./ops/docker-compose/mq/nats/nats.conf:/nats/conf/nats.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Client port of 4222 on all interfaces | ||
port: 4222 | ||
|
||
# HTTP monitoring port | ||
monitor_port: 8222 | ||
|
||
# websocket | ||
websocket { | ||
port: 8080 | ||
no_tls: true | ||
} | ||
|
||
# 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 nats-server docker image to create one to an existing server. | ||
routes = [] | ||
} |