Skip to content

Commit f599b1a

Browse files
authored
Update nats server and redis configurations (#1206)
* Update nats-server.conf Signed-off-by: Krishna Waske <[email protected]> * Create docker-compose.nats.yml Signed-off-by: Krishna Waske <[email protected]> * Create docker-compose.redis.yml Signed-off-by: Krishna Waske <[email protected]> --------- Signed-off-by: Krishna Waske <[email protected]>
1 parent 6c9d82d commit f599b1a

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

docker-compose.nats.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
services:
3+
nats:
4+
container_name: nats # Sets the name of the container to nats
5+
image: nats # Uses the official NATS Docker image
6+
command: ["-c", "/nats-server.conf"] # Passes the NATS configuration file to the container at startup
7+
ports:
8+
- '4222:4222' # Main NATS client communication port
9+
- '6222:6222' # Routing port for NATS clusters
10+
- '8222:8222' # HTTP monitoring port for server statistics and health checks
11+
volumes:
12+
- ./nats-server.conf:/nats-server.conf:ro # Mounts the nats-server.conf configuration file into the container as read-only (ro)

docker-compose.redis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
services:
3+
redis:
4+
image: redis:6.2-alpine
5+
restart: always
6+
ports:
7+
- '6379:6379'
8+
command: redis-server --save 20 1 --loglevel warning
9+
volumes:
10+
- cache:/data
11+
volumes:
12+
cache:

nats-server.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
port: 4222 # The main port for NATS communication is set to 4222.
2+
max_payload: 4194304 # 4 MB in bytes
3+
websocket {
4+
port: 443
5+
no_tls: true
6+
} # Enables WebSocket support on port 443 without TLS (for unsecured communication).

0 commit comments

Comments
 (0)