Files
homelable/docker-compose.yml
T
Pouzor e988427bb2 docs: explain why Docker bridge networking yields no MAC addresses
The default compose files put the backend on a bridge network, where ARP
only ever reaches the Docker gateway — so scans report IPs, ports and
services but never a MAC. NET_RAW does not help: it grants raw sockets,
not a place on the LAN. Rescan matching prefers MAC over IP, so this also
makes a DHCP device reappear as a new inventory entry when its lease
changes.

None of this was documented anywhere. Adds an INSTALLATION.md section
covering the network_mode: host fix, the Docker Desktop macOS/Windows
limitation and the macvlan alternative, a pointer from the README scanner
section, and a commented-out network_mode: host in both compose files so
it is a one-line change.

Reported in discussion #368.

ha-relevant: no
2026-09-02 15:58:07 +02:00

66 lines
1.5 KiB
YAML

services:
backend:
build:
context: .
dockerfile: Dockerfile.backend
restart: unless-stopped
env_file:
- .env
environment:
# Override env_file: SQLite path must point inside the container volume
SQLITE_PATH: /app/data/homelab.db
volumes:
- backend_data:/app/data
networks:
- homelable
# Required for ping-based status checks
cap_add:
- NET_RAW
# MAC addresses: on this bridge network the scanner can never see them —
# ARP is layer 2 and every LAN host is one hop away behind the Docker
# gateway. To collect MACs (and so keep DHCP devices matched across an IP
# change), put the backend on the LAN: comment out the `networks:` key
# above and uncomment the line below (Linux hosts only).
# network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health"]
interval: 10s
timeout: 5s
retries: 6
start_period: 15s
mcp:
build:
context: ./mcp
dockerfile: Dockerfile.mcp
restart: unless-stopped
ports:
- "8001:8001"
env_file:
- .env
environment:
BACKEND_URL: "http://backend:8000"
depends_on:
- backend
networks:
- homelable
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
restart: unless-stopped
ports:
- "3000:80"
depends_on:
- backend
networks:
- homelable
volumes:
backend_data:
networks:
homelable:
driver: bridge