nats的安裝docker方式

語言: CN / TW / HK

描述

docker-compose方式啟動nats-server。nats的映象非常小, docker-cpomse進行管理。下面是配置方式

docker-compose.yaml配置

version: "2"
services:
   nats-server:
       #image: provide/nats-server:latest
       image: nats:latest
       volumes:
           - ./nats-server.conf:/nats-server.conf
       ports:
           - 4222:4222

配置檔案nats-server.conf

# 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 = []
}

啟動

docker-compose -f docker-compose.yaml up/restart/start/stop

佛說大乘無量壽莊嚴清淨平等覺經pdf 淨土大經科注2014-doc 此生必看的科學實驗-水知道答案 印光大師十念法(胡小林主講第1集)