diff --git a/defaults/main.yml b/defaults/main.yml index dd9f75f..13ea68b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -107,7 +107,6 @@ geth_cache_size: ~ # Container memory limits geth_cont_mem_ratio: 0.6 geth_cont_mem_limit: '{{ (ansible_memtotal_mb * geth_cont_mem_ratio|float) | int }}' -geth_cont_swap_limit: '{{ (geth_cont_mem_limit|int) + (ansible_swaptotal_mb * geth_cont_mem_ratio|float) | int }}' # general container management compose_recreate: 'smart' diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index e63e117..d91fb6e 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -6,8 +6,10 @@ services: image: '{{ geth_cont_image }}' user: root restart: 'always' - mem_limit: '{{ geth_cont_mem_limit }}m' - memswap_limit: '{{ geth_cont_swap_limit }}m' + deploy: + resources: + limits: + memory: '{{ geth_cont_mem_limit }}m' ports: - '{{ geth_port }}:{{ geth_port }}/tcp' - '{{ geth_port }}:{{ geth_port }}/udp'