Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created January 17, 2020 14:41
Show Gist options
  • Save wshihadeh/7674435ee4790509e2ba8bb3e71a38dc to your computer and use it in GitHub Desktop.
Save wshihadeh/7674435ee4790509e2ba8bb3e71a38dc to your computer and use it in GitHub Desktop.
Portainer Docker Compose file
version: '3.7'
networks:
portainer:
name: portainer
driver: overlay
attachable: true
services:
agent:
image: portainer/agent
environment:
AGENT_CLUSTER_ADDR: tasks.agent
AGENT_SECRET: ${AGENT_SECRET}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
ports:
- target: 9001
published: 9001
protocol: tcp
mode: host
deploy:
mode: global
update_config:
delay: 10s
failure_action: rollback
order: start-first
parallelism: 1
resources:
reservations:
memory: 100M
limits:
memory: 300M
restart_policy:
condition: any
delay: 5s
max_attempts: 10
networks:
- portainer
web:
image: portainer/portainer
command: -H tcp://tasks.agent:9001 --tlsskipverify --admin-password='${PASSWORD}'
environment:
AGENT_SECRET: ${AGENT_SECRET}
deploy:
mode: replicated
placement:
constraints: [node.role == manager]
replicas: 1
update_config:
delay: 10s
failure_action: rollback
order: start-first
parallelism: 1
resources:
reservations:
memory: 100M
limits:
memory: 300M
restart_policy:
condition: any
delay: 5s
max_attempts: 10
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${PORT_VOLUME_PATH}:/data
networks:
- portainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment