增强退出时候的优化等待
This commit is contained in:
@@ -4,6 +4,8 @@ services:
|
|||||||
# 1) 本机 Consul agent(client)
|
# 1) 本机 Consul agent(client)
|
||||||
consul-agent:
|
consul-agent:
|
||||||
image: hashicorp/consul:1.21
|
image: hashicorp/consul:1.21
|
||||||
|
stop_signal: SIGTERM
|
||||||
|
stop_grace_period: 60s
|
||||||
container_name: consul-agent
|
container_name: consul-agent
|
||||||
network_mode: "host" # 避免 8301/udp/lan gossip 的端口映射问题
|
network_mode: "host" # 避免 8301/udp/lan gossip 的端口映射问题
|
||||||
command: >
|
command: >
|
||||||
@@ -16,6 +18,8 @@ services:
|
|||||||
-datacenter=${CONSUL_DC}
|
-datacenter=${CONSUL_DC}
|
||||||
-data-dir=/consul/data
|
-data-dir=/consul/data
|
||||||
-leave-on-terminate
|
-leave-on-terminate
|
||||||
|
environment:
|
||||||
|
CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}'
|
||||||
volumes:
|
volumes:
|
||||||
- ./consul-data:/consul/data
|
- ./consul-data:/consul/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
Reference in New Issue
Block a user