--- name: portainer-edge-agent networks: edge-agent_net: attachable: false internal: false external: false name: edge-agent driver: bridge ipam: driver: default config: - subnet: 172.20.18.0/24 ip_range: 172.20.18.0/24 gateway: 172.20.18.1 driver_opts: com.docker.network.bridge.default_bridge: "false" com.docker.network.bridge.enable_icc: "true" com.docker.network.bridge.enable_ip_masquerade: "true" com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" com.docker.network.bridge.name: "edge-agent" com.docker.network.driver.mtu: "1500" labels: com.edge-agent.network.description: "is an isolated bridge network." services: edge-agent_app: deploy: resources: limits: pids: 512 # Limits the number of processes and threads (fork bomb protection). restart: always logging: driver: "json-file" options: max-size: "1M" max-file: "2" stop_grace_period: 1m container_name: edge-agent image: docker.io/portainer/agent:3.1.0@sha256:225eb907e9758751278677ab3e9c0ac54d0e8995524b325aae193dd44fb6c328 volumes: - /docker/portainer/edge-agent/production/app:/data - /var/run/docker.sock:/var/run/docker.sock - /var/lib/docker/volumes:/var/lib/docker/volumes - /:/host:ro # Read-only view of the host file system for the host management features. env_file: # Compose loads each file that exists and skips a missing one: # '.env' for the Docker Compose CLI, 'stack.env' for Portainer. - path: .env required: false - path: stack.env required: false environment: TZ: Europe/Amsterdam # Adjust the timezone to match your local timezone. You can find the full list of timezones here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. EDGE: 1 EDGE_ID: ${PORTAINER_AGENT_ID} # Fill in the value in both the .env and stack.env files EDGE_KEY: ${PORTAINER_AGENT_KEY} # Fill in the value in both the .env and stack.env files EDGE_INSECURE_POLL: ${EDGE_INSECURE_POLL:-0} # Set to 1 in .env or stack.env only if the Portainer server uses a self-signed certificate. networks: edge-agent_net: ipv4_address: 172.20.18.2 security_opt: - no-new-privileges:true labels: com.edge-agent.description: "a remote environment is not directly accessible from docker server." healthcheck: disable: true