/
/
/
1# ==============================================================================
2# Unbound Docker Compose Configuration
3# ==============================================================================
4#
5# Description: Docker Compose configuration for Unbound DNS resolver
6# Generated by Ansible - DO NOT EDIT MANUALLY
7# Template: unbound-compose.yml.j2
8#
9# ==============================================================================
10
11version: '{{ docker_compose_version }}'
12
13services:
14 {{ unbound_service_name }}:
15 image: {{ unbound_image }}:{{ unbound_image_tag }}
16 container_name: {{ unbound_container_name }}
17
18 # Network configuration
19 networks:
20 {{ connectivity_network_name }}:
21 ipv4_address: {{ connectivity_subnet | regex_replace('/24$', '') }}.10
22
23 # Port mapping
24 ports:
25 - "{{ unbound_port }}:{{ unbound_port }}/udp"
26 - "{{ unbound_port }}:{{ unbound_port }}/tcp"
27
28 # Volume mounts
29 volumes:
30 - {{ docker_base_path }}/unbound/config:/opt/unbound/etc/unbound
31 - {{ docker_base_path }}/unbound/logs:/opt/unbound/var/log
32
33 # Environment variables
34 environment:
35 - TZ={{ pihole_timezone | default('UTC') }}
36 - PUID=1000
37 - PGID=1000
38
39 # Restart policy
40 restart: {{ default_restart_policy }}
41
42 # Security options
43 cap_add:
44 - NET_BIND_SERVICE
45
46 # Resource limits
47 deploy:
48 resources:
49 limits:
50 memory: 256M
51 cpus: '0.5'
52 reservations:
53 memory: 128M
54 cpus: '0.25'
55
56 # Health check
57 healthcheck:
58 test: ["CMD", "unbound-control", "status"]
59 interval: 30s
60 timeout: 10s
61 retries: 3
62 start_period: 40s
63
64 # Logging configuration
65 logging:
66 driver: {{ log_driver }}
67 options:
68 max-size: {{ log_max_size }}
69 max-file: "{{ log_max_file }}"
70
71networks:
72 {{ connectivity_network_name }}:
73 driver: bridge
74 ipam:
75 config:
76 - subnet: {{ connectivity_subnet }}
77
78# ==============================================================================
79# END OF UNBOUND DOCKER COMPOSE CONFIGURATION
80# ==============================================================================