Files
OpenPXE/docker-compose.yml
Miles WardandClaude Opus 4.8 27703c437a docs(compose): simplify root docker-compose to one pull-based service
The root compose was scratch-built and carried both a prod and a dev
service plus a local build stanza. Replace it with a single
deployment-focused service that pulls
gitea.milesward.dev/mward4/openpxe:latest (matching the Unraid
template and the homelab flow):

- drop the openpxe-dev service and the build: context (deploy, not build)
- HTTP on 4200 so it clears an Unraid webGUI / reverse proxy on :80
- host networking (DHCPDISCOVER is broadcast — bridges don't forward it)
- cap_add NET_BIND_SERVICE instead of privileged; the binary already
  carries cap_net_bind_service as a file capability
- OPENPXE_PUBLIC_IP stays a required, fail-fast variable
- isos + work bind mounts (SMB dir omitted — Windows boots via HTTP
  sanboot since v0.5.8, no SMB server needed)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-14 08:15:43 -04:00

43 lines
1.7 KiB
YAML

# OpenPXE — single-host / homelab deployment.
#
# One container: DHCP proxy + TFTP + iPXE chainload + HTTP (web UI, boot
# scripts, and ISO range streaming).
#
# OPENPXE_PUBLIC_IP=192.168.1.49 docker compose up -d
#
# (or put OPENPXE_PUBLIC_IP in a .env file beside this one). That's this
# host's LAN IP, advertised to PXE clients so the iPXE URLs resolve —
# OpenPXE refuses to start rather than advertise an address clients can't
# reach, so compose errors out below if it's unset.
#
# Host networking is REQUIRED: DHCPDISCOVER is a broadcast, and Docker
# bridges / CNI overlays don't forward it into containers. In host mode
# the container binds these ports directly on the host:
#
# udp/67 DHCP proxy udp/4011 PXE Boot Server
# udp/69 TFTP tcp/4200 web UI + HTTP boot assets
#
# Web UI: http://<this-host>:4200/
services:
openpxe:
image: gitea.milesward.dev/mward4/openpxe:latest
container_name: openpxe
restart: unless-stopped
network_mode: host
# The binary carries cap_net_bind_service as a file capability, so it
# binds the low DHCP/TFTP ports as a non-root user — no privileged mode.
cap_add:
- NET_BIND_SERVICE
environment:
OPENPXE_PUBLIC_IP: ${OPENPXE_PUBLIC_IP:?set this to the host LAN IP, e.g. 192.168.1.49}
# Web UI + HTTP boot assets. 4200 keeps clear of anything on :80
# (an Unraid webGUI, a reverse proxy, …).
OPENPXE_HTTP_PORT: "4200"
# proxy = coexist with the LAN's existing DHCP server (recommended).
OPENPXE_DHCP_MODE: proxy
OPENPXE_LOG: info
volumes:
- ./data/isos:/var/lib/openpxe/isos # uploaded / seeded .iso files
- ./data/work:/var/lib/openpxe/work # settings, share state, scratch