diff --git a/docker-compose-build.yml b/docker-compose-build.yml new file mode 100644 index 0000000..117a92c --- /dev/null +++ b/docker-compose-build.yml @@ -0,0 +1,37 @@ +services: + nettrak: + container_name: NetTrak + restart: unless-stopped + build: . + + environment: + - NETTRAK_DB_PATH=/data/nettrak.db + # Set this to your local subnet. Example for common home network: + - NETTRAK_SUBNET=192.168.2.0/24 + - NETTRAK_TOP_PORTS=100 + # Optional explicit port set/range. Example catches most app ports: + - NETTRAK_PORT_SPEC=1-10000 + - NETTRAK_SCAN_WORKERS=12 + - NETTRAK_PORT_PROBE_TIMEOUT=0.4 + - NETTRAK_ENABLE_OS_DETECTION=0 + - NETTRAK_ENABLE_DOCKER_INSIGHTS=1 + # Set this if Docker published ports are bound to 0.0.0.0 and host IP cannot be inferred. + - NETTRAK_DOCKER_HOST_IP=192.168.2.23 + + # For best host discovery on Linux, use host mode. + # If you do that, remove the `ports` section and ensure port 1337 is free. + # NOTE: If you want/need to change the port, you have to rebuild the image to update the EXPOSE instruction (see docker-compose-build.yml). + # network_mode: host + + # Helps nmap discover MAC addresses/OS details in containerized runs. + cap_add: + - NET_ADMIN + - NET_RAW + + ports: + - "1337:1337" + + volumes: + - ./data:/data + # Optional: mount Docker socket to include container-published host ports in results. + # - /var/run/docker.sock:/var/run/docker.sock:ro diff --git a/docker-compose.yml b/docker-compose.yml index 2a4f589..46fb485 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,35 +1,38 @@ services: nettrak: container_name: NetTrak - build: . restart: unless-stopped + image: git.keithsolomon.net/keith/nettrak:latest environment: - NETTRAK_DB_PATH=/data/nettrak.db + # Set this to your local subnet. Example for common home network: - NETTRAK_SUBNET=192.168.2.0/24 - NETTRAK_TOP_PORTS=100 - # Optional explicit port set/range. Example catches 8989 and many app ports: - # - NETTRAK_PORT_SPEC=1-10000 + # Optional explicit port set/range. Example catches most app ports: + - NETTRAK_PORT_SPEC=1-10000 - NETTRAK_SCAN_WORKERS=12 - NETTRAK_PORT_PROBE_TIMEOUT=0.4 - NETTRAK_ENABLE_OS_DETECTION=0 - - NETTRAK_ENABLE_DOCKER_INSIGHTS=0 + - NETTRAK_ENABLE_DOCKER_INSIGHTS=1 # Set this if Docker published ports are bound to 0.0.0.0 and host IP cannot be inferred. - # - NETTRAK_DOCKER_HOST_IP=192.168.2.10 + - NETTRAK_DOCKER_HOST_IP=192.168.2.23 - # For best host discovery on Linux, you can switch to host mode. - # If you do that, remove the `ports` section and ensure APP_PORT is free. - # network_mode: host + # For best host discovery on Linux, use host mode. + # If you do that, remove the `ports` section and ensure port 1337 is free. + # NOTE: If you want/need to change the port, you have to rebuild the image to update the EXPOSE instruction (see docker-compose-build.yml). + #network_mode: host # Helps nmap discover MAC addresses/OS details in containerized runs. cap_add: - NET_ADMIN - NET_RAW - ports: + # ports: - "1337:1337" volumes: + # Store the database on the host for persistence across container restarts and easy access. - ./data:/data # Optional: mount Docker socket to include container-published host ports in results. - # - /var/run/docker.sock:/var/run/docker.sock:ro + - /var/run/docker.sock:/var/run/docker.sock:ro