diff --git a/docker-swarm.yml b/docker-swarm.yml new file mode 100644 index 00000000..d936f5fe --- /dev/null +++ b/docker-swarm.yml @@ -0,0 +1,185 @@ +version: '3' +services: + sonic-server-eureka: + image: "sonicorg/sonic-server-eureka:v1.3.1-release" + hostname: sonic-server-eureka + environment: + - EUREKA_HOST=sonic-server-eureka # You should checkout sonic-server-eureka env to support more. + networks: + - sonic-network + volumes: + - ./logs/:/logs/ + ports: + - "9090:9090" + deploy: + replicas: 1 # one or more. + placement: + constraints: + - node.role == manager + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-bus: + image: "sonicorg/sonic-server-bus:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./config:/config + - ./logs/:/logs/ + depends_on: + - sonic-server-eureka + deploy: + replicas: 1 + placement: + constraints: + - node.role == manager + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-gateway: + image: "sonicorg/sonic-server-gateway:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./logs/:/logs/ + depends_on: + - sonic-server-bus + - sonic-server-eureka + ports: + - "8094:8094" + deploy: + replicas: 1 + placement: + constraints: + - node.role == worker + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-controller: + image: "sonicorg/sonic-server-controller:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./logs/:/logs/ + depends_on: + - sonic-server-bus + - sonic-server-eureka + - sonic-server-gateway + deploy: + replicas: 2 # one or more. + placement: + constraints: + - node.role == worker + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-folder: + image: "sonicorg/sonic-server-folder:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./keepFiles/:/keepFiles/ + - ./imageFiles/:/imageFiles/ + - ./recordFiles/:/recordFiles/ + - ./packageFiles/:/packageFiles/ + - ./logs/:/logs/ + depends_on: + - sonic-server-bus + - sonic-server-eureka + - sonic-server-gateway + deploy: + replicas: 1 # one or more. You should note that the master and slave machines share folders. + placement: + constraints: + - node.role == manager + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-task: + image: "sonicorg/sonic-server-task:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./logs/:/logs/ + depends_on: + - sonic-server-bus + - sonic-server-eureka + - sonic-server-gateway + deploy: + replicas: 1 # one or more. + placement: + constraints: + - node.role == worker + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + sonic-server-transport: + image: "sonicorg/sonic-server-transport:v1.3.1-release" + environment: + - PROFILE=prod + - EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/ + networks: + - sonic-network + volumes: + - ./logs/:/logs/ + depends_on: + - sonic-server-bus + - sonic-server-eureka + - sonic-server-gateway + ports: + - "8095:8095" + deploy: + replicas: 1 # transport should only one. + placement: + constraints: + - node.role == worker + update_config: + parallelism: 1 + delay: 2s + restart_policy: + condition: on-failure + delay: 20s + max_attempts: 6 + +networks: + sonic-network: + driver: overlay \ No newline at end of file