--- services: app: container_name: portainer-agent deploy: mode: global image: portainer/agent:latest ports: - 9001:9001 volumes: - /var/run/docker.sock:/var/run/docker.sock - /var/lib/docker/volumes:/var/lib/docker/volumes networks: - portainer-agent_default restart: unless-stopped