add restart_policy section to docker compose

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-03-26 16:12:48 +01:00
parent eb798800c7
commit a85f7e906b
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,12 @@ beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.6) | int }}'
beacon_node_cpu_reserve: 0.20
beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.2) | int }}'
# container restart policy
beacon_node_restart_ondition: 'on-failure'
beacon_node_restart_max_attempts: 3
beacon_node_restart_delay_sec: 10
beacon_node_restart_window_sec: 120
# general container management
compose_state: 'present'
compose_recreate: 'smart'

View File

@ -23,6 +23,11 @@
reservations:
cpus: '{{ beacon_node_cpu_reserve | string }}'
memory: '{{ beacon_node_mem_reserve }}M'
restart_policy:
condition: '{{ beacon_node_restart_ondition }}'
max_attempts: '{{ beacon_node_restart_max_attempts }}'
delay: '{{ beacon_node_restart_delay_sec }}s'
window: '{{ beacon_node_restart_window_sec }}s'
ports:
- '127.0.0.1:{{ beacon_node_rpc_port }}:{{ beacon_node_rpc_port }}/tcp'
- '{{ beacon_node_metrics_port }}:{{ beacon_node_metrics_port }}/tcp'