system-config/playbooks/roles/gerrit/templates/docker-compose.yaml.j2
Monty Taylor f934851ad8 Set ulimits for gerrit
We set core size to 0 and number of files to twice the setting of
core.packedGitOpenFiles. Make gerrit_packed_git_open_files a role
variable so we can jinja the 2x transformation.

Change-Id: I05dbfe1f091e7014c47b0f1ba79f99b51d1a6c30
2020-03-21 11:41:00 -05:00

30 lines
682 B
Django/Jinja

version: '2'
services:
gerrit:
image: {{ gerrit_container_image }}
network_mode: host
user: gerrit
volumes:
{% for volume in gerrit_container_volumes %}
- {{ volume }}
{% endfor %}
{% if gerrit_heap_limit is defined %}
environment:
JAVA_OPTIONS: "-Xmx{{ gerrit_heap_limit }}"
{% endif %}
ulimits:
core: 0
nofile: {{ gerrit_packed_git_open_files * 2 }}
# Utility "service" to allow us to run ad-hoc commands
shell:
image: {{ gerrit_container_image }}
restart: 'no'
command: /bin/true
network_mode: host
user: gerrit
volumes:
{% for volume in gerrit_container_volumes %}
- {{ volume }}
{% endfor %}