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