services: mqtt-sniffer: build: . container_name: mqtt-sniffer # Host networking is required so the container can see the WiFi adapter network_mode: host # Instead of full `privileged: true`, grant only the capabilities actually # needed: # NET_ADMIN - hostapd, iw, ip, and iptables # NET_RAW - scapy raw packet sockets # This requires net.ipv4.ip_forward to be enabled on the HOST (see README), # since /proc/sys/net is read-only to an unprivileged container under host # networking. hostapd may also need /dev/rfkill (uncomment `devices` below). cap_add: - NET_ADMIN - NET_RAW # devices: # - /dev/rfkill # Fallback: if your adapter/driver won't come up with the capabilities # above, comment out `cap_add` and use full privileged mode instead: # privileged: true restart: unless-stopped environment: - MQTT_BROKER= - MQTT_PORT=1883 - MQTT_TOPIC= - AP_SSID= - AP_PASSWORD= - WLAN_IFACE= - AP_COUNTRY=US - AP_CHANNEL=1 - VERBOSE=false - PYTHONUNBUFFERED=1