deployment/ansible/roles/portainer-deploy/templates/portainer-stack.yml.j2

54 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-12-11 16:28:17 +01:00
# vim: ft=yaml
2021-12-13 16:38:17 +01:00
version: '3.2'
2021-12-11 16:28:17 +01:00
services:
app:
2021-12-23 12:01:28 +01:00
image: 'portainer/portainer-ce:{{ portainer.version }}-alpine'
2021-12-11 16:28:17 +01:00
command: '-H tcp://tasks.agent:9001 --tlsskipverify'
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
labels:
- 'traefik.enable=true'
2021-12-23 12:01:28 +01:00
- 'traefik.http.routers.portainer.rule=Host(`{{ portainer.domain }}`)'
2021-12-11 16:28:17 +01:00
- 'traefik.http.routers.portainer.service=portainer'
- 'traefik.http.services.portainer.loadbalancer.server.port=9000'
- 'traefik.http.routers.portainer.tls=true'
- 'traefik.http.routers.portainer.tls.certresolver=letsEncrypt'
2021-12-18 10:30:44 +01:00
- 'traefik.http.middlewares.portainer.compress=true'
2021-12-11 16:28:17 +01:00
networks:
- default
- public
volumes:
- 'data:/data'
ports:
- '8000:8000'
agent:
2021-12-23 12:01:28 +01:00
image: 'portainer/agent:{{ portainer.version }}-alpine'
2021-12-11 16:28:17 +01:00
deploy:
mode: global
placement:
constraints:
- node.platform.os == linux
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/var/lib/docker/volumes:/var/lib/docker/volumes'
networks:
2021-12-13 16:38:17 +01:00
default:
driver: overlay
attachable: true
2021-12-11 16:28:17 +01:00
public:
external: true
volumes:
data: