2025-03-26 18:22:07 +08:00
|
|
|
# RUN:: docker stack deploy -c <(docker compose --env-file ./env.cfg -f ./portainer-agent-stack.yml config) base
|
2026-11-05 23:18:54 +08:00
|
|
|
# curl -L https://downloads.portainer.io/ce-lts/portainer-agent-stack.yml -o portainer-agent-stack.yml
|
2026-11-05 23:18:47 +08:00
|
|
|
# RUN:: docker stack deploy -c portainer-agent-stack.yml portainer
|
2021-08-27 14:15:37 +08:00
|
|
|
services:
|
|
|
|
|
agent:
|
2026-11-05 23:01:05 +08:00
|
|
|
image: portainer/agent:2.45.3
|
2021-08-27 14:15:37 +08:00
|
|
|
volumes:
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2024-02-28 17:18:52 +08:00
|
|
|
- /data/docker/volumes:/var/lib/docker/volumes
|
2021-08-27 14:15:37 +08:00
|
|
|
networks:
|
|
|
|
|
- agent_network
|
|
|
|
|
deploy:
|
|
|
|
|
mode: global
|
|
|
|
|
placement:
|
|
|
|
|
constraints: [node.platform.os == linux]
|
|
|
|
|
|
|
|
|
|
portainer:
|
2026-11-05 23:01:05 +08:00
|
|
|
image: portainer/portainer-ce:2.45.3
|
2021-08-27 14:15:37 +08:00
|
|
|
command: -H tcp://tasks.agent:9001 --tlsskipverify
|
|
|
|
|
ports:
|
|
|
|
|
- "9000:9000"
|
|
|
|
|
- "8000:8000"
|
|
|
|
|
volumes:
|
|
|
|
|
- portainer_data:/data
|
|
|
|
|
networks:
|
|
|
|
|
- agent_network
|
|
|
|
|
deploy:
|
|
|
|
|
mode: replicated
|
|
|
|
|
replicas: 1
|
|
|
|
|
placement:
|
|
|
|
|
constraints: [node.role == manager]
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
agent_network:
|
|
|
|
|
driver: overlay
|
|
|
|
|
attachable: true
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
portainer_data:
|