diff --git a/docker-compose.override.example.yaml b/docker-compose.override.example.yaml index c144afc..9dd6371 100644 --- a/docker-compose.override.example.yaml +++ b/docker-compose.override.example.yaml @@ -27,3 +27,21 @@ services: # - "22001:22000/udp" # - "21028:21027/udp" # restart: unless-stopped + + # ------------------------------------------------------------------------- + # Advanced / legacy: switch back to host network mode + # + # Use this when the container needs full access to all host network + # interfaces (e.g. LAN service discovery, binding to arbitrary ports). + # WARNING: this removes network isolation — the container can reach + # everything on the host network stack, including SSH, SMB, databases, + # and other local services. + # + # Add the block below to your docker-compose.override.yaml to activate. + # Note: "ports: !reset []" clears the port mappings from the base file, + # which are incompatible with host network mode. + # Requires Docker Compose >= 2.24.0 (ships with Docker Desktop 4.28+). + # ------------------------------------------------------------------------- + # openclaw-gateway: + # network_mode: "host" + # ports: !reset [] diff --git a/docker-compose.yaml b/docker-compose.yaml index f187fa5..6071025 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,11 @@ services: OPENCLAW_VERSION: ${OPENCLAW_VERSION:-latest} container_name: openclaw-gateway restart: unless-stopped - network_mode: "host" + ports: + - "18789:18789" + - "18790:18790" + extra_hosts: + - "host.docker.internal:host-gateway" env_file: .env environment: - NODE_ENV=production