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

51 lines
1.2 KiB
Django/Jinja

version: '3.8'
networks:
{% if shinyproxy_container_backend == 'docker-swarm' %}
haproxy-public:
external: true
{% endif %}
{{ shinyproxy_docker_network }}:
configs:
shinyproxy_conf:
file: {{ shinyproxy_as_docker_src_dir }}/application.yml
services:
shinyproxy:
{% if shinyproxy_container_backend == 'docker' %}
build: .
ports:
- '{{ shinyproxy_http_port }}':'{{ shinyproxy_http_port }}'
{% else %}
image: {{ shinyproxy_docker_image }}
{% endif %}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: shinyproxy_conf
target: /opt/shinyproxy/application.yml
mode: 0400
networks:
- {{ shinyproxy_docker_network }}
{% if shinyproxy_container_backend == 'docker-swarm' %}
- haproxy-public
{% endif %}
{% if shinyproxy_container_backend == 'docker-swarm' %}
deploy:
mode: replicated
replicas: {{ shinyproxy_docker_swarm_replicas }}
endpoint_mode: dnsrr
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
{% endif %}
{% if shinyproxy_docker_log_to_journal %}
logging:
driver: 'journald'
{% endif %}