xoxys.droneci_runner_docker/templates/services/droneci_runner_compose.yml.j2

45 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-06-15 19:15:20 +00:00
#jinja2:lstrip_blocks: True
{{ ansible_managed | comment }}
2020-06-17 19:22:56 +00:00
version: "2.4"
2020-06-15 19:15:20 +00:00
services:
droneci_runner_docker:
container_name: {{ droneci_runner_docker_container_name }}
image: {{ droneci_runner_docker_image }}
2020-06-16 20:03:44 +00:00
restart: {{ droneci_runner_docker_restart_policy }}
2020-06-15 19:15:20 +00:00
volumes:
- {{ droneci_runner_docker_socket_path }}:/var/run/docker.sock
{% if droneci_runner_docker_networks_applied | default([]) %}
networks:
{% for network in droneci_runner_docker_networks_applied %}
- {{ network }}
{% endfor %}
{% endif %}
privileged: true
environment:
2021-12-07 21:20:21 +00:00
- DRONE_RPC_PROTO={{ droneci_runner_docker_server_proto }}
- DRONE_RPC_HOST={{ droneci_runner_docker_server_host }}
- DRONE_RPC_SECRET={{ droneci_runner_docker_server_secret }}
2020-06-15 19:15:20 +00:00
- DRONE_RUNNER_CAPACITY={{ droneci_runner_docker_capacity }}
{% if droneci_drone_runner_labels | default([]) | length > 0 %}
- DRONE_RUNNER_LABELS={{ droneci_drone_runner_labels | join(",") }}
{% endif %}
{% if droneci_runner_docker_memory_limit is defined %}
mem_limit: {{ droneci_runner_docker_memory_limit }}
{% endif %}
{% if droneci_runner_docker_memory_reservation is defined %}
mem_reservation: {{ droneci_runner_docker_memory_reservation }}
2020-06-15 19:15:20 +00:00
{% endif %}
2020-06-16 19:48:34 +00:00
{% if droneci_runner_docker_networks | default([]) | length > 0 %}
2020-06-15 19:15:20 +00:00
networks:
{% for network in droneci_runner_docker_networks %}
{{ network.name }}:
{% if network.external | default(False) | bool %}
external: true
{% else %}
driver: {{ network.backend | default("bridge") }}
{% endif %}
{% endfor %}
{% endif %}