46 lines
1.3 KiB
Django/Jinja
46 lines
1.3 KiB
Django/Jinja
networks:
|
|
portainer:
|
|
traefik:
|
|
external: true
|
|
|
|
services:
|
|
agent:
|
|
image: portainer/agent:latest
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /var/lib/docker/volumes:/var/lib/docker/volumes
|
|
networks:
|
|
- portainer
|
|
environment:
|
|
AGENT_SECRET: {{portainer_agent_secret}}
|
|
deploy:
|
|
mode: global
|
|
placement:
|
|
constraints: [node.platform.os == linux]
|
|
|
|
portainer:
|
|
image: portainer/portainer:latest
|
|
command: "-H tcp://tasks.agent:9001 --tlsskipverify --bind :9000 --tunnel-port 8000 --admin-password {{portainer_htpasswd}}"
|
|
ports:
|
|
- "9000:9000"
|
|
- "8000:8000"
|
|
volumes:
|
|
- {{nfs_mount_path}}/portainer/data:/data
|
|
networks:
|
|
- portainer
|
|
- traefik
|
|
environment:
|
|
AGENT_SECRET: {{portainer_agent_secret}}
|
|
deploy:
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.portainer.rule=Host(`portainer.{{app_domain_name}}`)"
|
|
- "traefik.http.routers.portainer.entrypoints=websecure"
|
|
- "traefik.http.routers.portainer.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
|
|
- "traefik.swarm.network=traefik"
|
|
mode: replicated
|
|
replicas: 1
|
|
placement:
|
|
constraints: [node.role == manager]
|