x-netvisor-env: &netvisor-env NETVISOR_LOG_LEVEL: ${NETVISOR_LOG_LEVEL:-info} NETVISOR_SERVER_PORT: ${NETVISOR_SERVER_PORT:-60072} NETVISOR_DAEMON_PORT: ${NETVISOR_DAEMON_PORT:-60073} services: daemon: image: mayanayza/netvisor-daemon:latest container_name: netvisor-daemon network_mode: host privileged: true restart: unless-stopped ports: - "${NETVISOR_DAEMON_PORT:-60073}:${NETVISOR_DAEMON_PORT:-60073}" environment: <<: *netvisor-env NETVISOR_SERVER_URL: ${NETVISOR_SERVER_URL:-http://127.0.0.1:60072} NETVISOR_PORT: ${NETVISOR_DAEMON_PORT:-60073} NETVISOR_BIND_ADDRESS: ${NETVISOR_BIND_ADDRESS:-0.0.0.0} NETVISOR_NAME: ${NETVISOR_NAME:-netvisor-daemon} NETVISOR_HEARTBEAT_INTERVAL: ${NETVISOR_HEARTBEAT_INTERVAL:-30} NETVISOR_MODE: ${NETVISOR_MODE:-Push} healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:${NETVISOR_DAEMON_PORT:-60073}/api/health || exit 1"] interval: 5s timeout: 3s retries: 15 volumes: - daemon-config:/root/.config/daemon # Comment out the line below to disable docker discovery - /var/run/docker.sock:/var/run/docker.sock:ro postgres: image: postgres:17-alpine environment: POSTGRES_DB: netvisor POSTGRES_USER: postgres POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped networks: - netvisor server: image: mayanayza/netvisor-server:latest ports: - "${NETVISOR_SERVER_PORT:-60072}:${NETVISOR_SERVER_PORT:-60072}" environment: <<: *netvisor-env NETVISOR_DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-password}@postgres:5432/netvisor NETVISOR_WEB_EXTERNAL_PATH: /app/static NETVISOR_PUBLIC_URL: ${NETVISOR_PUBLIC_URL:-http://localhost:${NETVISOR_SERVER_PORT:-60072}} # How server reaches integrated daemon # 172.17.0.1 is Docker's default bridge gateway. If your's is different, make sure to change it. NETVISOR_INTEGRATED_DAEMON_URL: http://172.17.0.1:${NETVISOR_DAEMON_PORT:-60073} volumes: - ./data:/data depends_on: postgres: condition: service_healthy daemon: condition: service_healthy restart: unless-stopped networks: - netvisor volumes: postgres_data: daemon-config: networks: netvisor: driver: bridge ipam: config: - subnet: 172.31.0.0/16 gateway: 172.31.0.1