ansible-role-shinyproxy/templates/shinyproxy-docker-compose.y...

76 lines
2.3 KiB
Plaintext
Raw Normal View History

2020-11-09 19:04:39 +01:00
version: '3.8'
networks:
2021-04-13 19:57:26 +02:00
{% if shinyproxy_container_backend == 'docker-swarm' and shinyproxy_docker_swarm_behind_haproxy %}
haproxy-public:
external: true
{% endif %}
{{ shinyproxy_docker_network }}:
2020-09-23 16:40:51 +02:00
{% if not shinyproxy_docker_mount_conf_file %}
2020-11-09 19:00:50 +01:00
configs:
shinyproxy_conf:
2020-11-17 12:25:50 +01:00
file: {{ shinyproxy_as_docker_src_dir }}/application.yml
{% endif %}
2020-09-23 16:40:51 +02:00
services:
shinyproxy:
{% if shinyproxy_container_backend == 'docker' %}
2020-09-23 16:40:51 +02:00
build: .
ports:
2021-04-18 21:02:12 +02:00
- target: {{ shinyproxy_http_port }}
published: :{{ shinyproxy_http_port }}
protocol: tcp
mode: '{{ shinyproxy_docker_http_port_mode }}'
{% if shinyproxy_expose_prometheus and shinyproxy_version is version_compare('2.5.0', '>=') %}
2021-04-18 21:02:12 +02:00
- target: 9090
published: {{ shinyproxy_prometheus_port }}
protocol: tcp
mode: 'host'
{% endif %}
{% else %}
image: {{ shinyproxy_docker_image }}
2021-04-13 19:57:26 +02:00
{% if not shinyproxy_docker_swarm_behind_haproxy %}
ports:
- {{ shinyproxy_http_port }}:{{ shinyproxy_http_port }}
{% if shinyproxy_expose_prometheus and shinyproxy_version is version_compare('2.5.0', '>=') %}
- {{ shinyproxy_prometheus_port }}:{{ shinyproxy_prometheus_port }}
{% endif %}
{% endif %}
{% endif %}
2020-09-23 16:40:51 +02:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock
{% if shinyproxy_docker_mount_conf_file %}
- {{ shinyproxy_as_docker_src_dir }}/application.yml:{{ shinyproxy_conf_dir }}/application.yml
{% endif %}
{% if not shinyproxy_docker_mount_conf_file %}
2020-11-09 19:00:50 +01:00
configs:
- source: shinyproxy_conf
2020-11-17 12:25:50 +01:00
target: {{ shinyproxy_conf_dir }}/application.yml
2020-11-09 19:00:50 +01:00
mode: 0400
{% endif %}
networks:
- {{ shinyproxy_docker_network }}
2021-04-13 19:57:26 +02:00
{% if shinyproxy_container_backend == 'docker-swarm' and shinyproxy_docker_swarm_behind_haproxy %}
- haproxy-public
{% endif %}
{% if shinyproxy_container_backend == 'docker-swarm' %}
2020-09-23 16:40:51 +02:00
deploy:
mode: replicated
replicas: {{ shinyproxy_docker_swarm_replicas }}
2021-04-13 19:57:26 +02:00
{% if shinyproxy_docker_swarm_behind_haproxy %}
endpoint_mode: dnsrr
2021-04-13 19:57:26 +02:00
{% endif %}
2020-09-23 16:40:51 +02:00
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
{% endif %}
2020-10-08 15:28:27 +02:00
{% if shinyproxy_docker_log_to_journal %}
logging:
driver: 'journald'
{% endif %}
2020-09-23 16:40:51 +02:00