1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# lazydns Docker Compose configuration (Example)
# Podman-friendly: removed Swarm-only `deploy` section (resource limits)
# and prefer bind-mounts / named volumes. Use `podman compose up -d`.
#
# Note: For rootless Podman, ensure low port binding is allowed:
# systemctl --user enable --now podman.socket
# sudo sysctl -w net.ipv4.ip_unprivileged_port_start=53
#
# To make persistent across reboots, create a sysctl config file:
# echo "net.ipv4.ip_unprivileged_port_start=53" | sudo tee /etc/sysctl.d/99-unprivileged-ports.conf
# sudo sysctl --system
services:
lazydns:
image: lazywalker:latest
container_name: lazydns
# Network configuration
ports:
- "53:53/udp" # DNS UDP
- "53:53/tcp" # DNS TCP
- "853:853/tcp" # DoT
- "443:443/tcp" # DoH
- "784:784/tcp" # DoQ
- "8000:8000/tcp" # ADMIN HTTP API
- "8001:8001/tcp" # METRICS HTTP API
- "8002:8002/tcp" # WEB UI
# Volume mounts
volumes:
- ./etc/lazydns:/etc/lazydns
- ./log:/var/log/lazydns
# Environment variables
environment:
- RUST_LOG=debug
- RUST_BACKTRACE=1
- LOG_FORMAT=text
- PLUGINS_AUTO_UPDATE_SCHEDULER_ARGS_JOBS_0_CRON="10 2 * * *"
- TZ=Asia/Shanghai
# Allow binding low ports (<1024) from non-root processes inside container.
# Podman/Docker: container must have the capability; rootless Podman may still
# restrict this; run with sudo or grant capability on the host if needed.
cap_add:
- CAP_NET_BIND_SERVICE
# Restart policy
restart: unless-stopped
# Health check
healthcheck:
test:
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
volumes:
lazydns-rules:
driver: local