version: "3.7" services: portainer: image: portainer/portainer:1.24.1-alpine@sha256:67821db9fefb08c0d0f073d04250ec57d4db25bfcd16c436618c08038b9dae33 command: -H tcp://tasks.portainer-agent:9001 --tlsskipverify # command: -H unix:///var/run/docker.sock deploy: replicas: 1 placement: constraints: [node.role == manager] restart_policy: condition: any volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer-data:/data networks: #- proxy - appnet - externalnet portainer-agent: image: portainer/agent:2.0.0@sha256:8f994457bc32480bff351f0b1d371557238e69f5902037addfe76fa7bd930b9d environment: # REQUIRED: Should be equal to the service name prefixed by "tasks." when # deployed inside an overlay network AGENT_CLUSTER_ADDR: tasks.portainer-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: - appnet deploy: mode: global placement: constraints: [node.platform.os == linux] volumes: portainer-data: networks: appnet: driver: overlay #external: true externalnet: driver: overlay external: true