ansible-role-docker-swarm/templates/portainer-agent-stack.yml.j2

58 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-09-30 17:14:29 +02:00
version: '3.2'
services:
agent:
image: portainer/agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- '{{ docker_swarm_portainer_network }}'
deploy:
mode: global
placement:
constraints: [node.platform.os == linux]
{% if docker_log_to_journal %}
log_driver: 'journald'
{% endif %}
portainer:
image: portainer/portainer-ce
command: -H tcp://tasks.agent:9001 --tlsskipverify
#ports:
# - "{{ docker_swarm_portainer_http_port }}:9000"
# - "{{ docker_swarm_portainer_service_port }}:8000"
expose:
- "9000"
- "8000"
volumes:
- portainer_data:/data
networks:
- '{{ docker_swarm_portainer_network }}'
deploy:
mode: replicated
replicas: 1
endpoint_mode: dnsrr
restart_policy:
condition: unless-stopped
delay: 5s
max_attempts: 3
window: 120s
placement:
constraints:
- 'node.role == manager'
{% for constraint in docker_swarm_portainer_additional_constraints %}
- '{{ constraint }}'
{% endfor %}
{% if docker_log_to_journal %}
log_driver: 'journald'
{% endif %}
networks:
2020-10-01 16:41:55 +02:00
{{ docker_swarm_portainer_network }}:
2020-09-30 17:14:29 +02:00
driver: overlay
attachable: true
volumes:
portainer_data: