Last active
June 30, 2019 23:00
-
-
Save zironycho/0e53a5e4e2df1e29aed845dba94be64c to your computer and use it in GitHub Desktop.
portainer stack with traefik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
services: | |
agent: | |
image: portainer/agent | |
environment: | |
# REQUIRED: Should be equal to the service name prefixed by "tasks." when | |
# deployed inside an overlay network | |
AGENT_CLUSTER_ADDR: tasks.agent | |
# AGENT_PORT: 9001 | |
# LOG_LEVEL: debug | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /var/lib/docker/volumes:/var/lib/docker/volumes | |
networks: | |
- agent_network | |
deploy: | |
mode: global | |
placement: | |
constraints: [node.platform.os == linux] | |
portainer: | |
image: portainer/portainer | |
command: -H tcp://tasks.agent:9001 --tlsskipverify | |
volumes: | |
- portainer_data:/data | |
networks: | |
- agent_network | |
- proxy | |
deploy: | |
mode: replicated | |
replicas: 1 | |
placement: | |
constraints: [node.role == manager] | |
labels: | |
- traefik.docker.network=proxy | |
- traefik.backend={{ .Stack.Name }}_portainer | |
- traefik.port=9000 | |
- traefik.frontend.rule=Host:${HOST};PathPrefixStrip:/portainer | |
networks: | |
agent_network: | |
driver: overlay | |
attachable: true | |
proxy: | |
external: | |
name: proxy | |
volumes: | |
portainer_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
required
environment variable:
HOST
: your traefik host addressnetwork:
proxy
: overlay network for traefiktraefik
deploy
reference: