2020-09-30 17:14:29 +02:00
|
|
|
version: '3.2'
|
|
|
|
|
2020-10-26 17:59:30 +01:00
|
|
|
volumes:
|
|
|
|
portainer_data:
|
|
|
|
|
|
|
|
networks:
|
|
|
|
{{ haproxy_docker_overlay_network }}:
|
|
|
|
external: true
|
|
|
|
{{ docker_swarm_portainer_network }}:
|
|
|
|
|
2020-09-30 17:14:29 +02:00
|
|
|
services:
|
|
|
|
agent:
|
|
|
|
image: portainer/agent
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
- /var/lib/docker/volumes:/var/lib/docker/volumes
|
|
|
|
deploy:
|
|
|
|
mode: global
|
|
|
|
placement:
|
|
|
|
constraints: [node.platform.os == linux]
|
2020-10-12 17:45:05 +02:00
|
|
|
networks:
|
|
|
|
- {{ docker_swarm_portainer_network }}
|
2020-09-30 17:14:29 +02:00
|
|
|
{% if docker_log_to_journal %}
|
2020-10-01 18:12:06 +02:00
|
|
|
logging:
|
|
|
|
driver: 'journald'
|
2020-09-30 17:14:29 +02:00
|
|
|
{% 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"
|
|
|
|
volumes:
|
|
|
|
- portainer_data:/data
|
2020-10-12 17:45:05 +02:00
|
|
|
networks:
|
|
|
|
- {{ docker_swarm_portainer_network }}
|
2020-10-26 17:59:30 +01:00
|
|
|
- {{ haproxy_docker_overlay_network }}
|
2020-09-30 17:14:29 +02:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
|
|
|
replicas: 1
|
|
|
|
endpoint_mode: dnsrr
|
|
|
|
restart_policy:
|
2020-10-01 18:36:33 +02:00
|
|
|
condition: on-failure
|
2020-09-30 17:14:29 +02:00
|
|
|
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 %}
|
2020-10-01 17:38:36 +02:00
|
|
|
logging:
|
|
|
|
driver: 'journald'
|
2020-09-30 17:14:29 +02:00
|
|
|
{% endif %}
|
|
|
|
|