deploy_adguard/templates/docker-compose.yml.j2
2023-06-02 15:25:56 +02:00

94 lines
2.2 KiB
Django/Jinja

---
version: '3.9'
services:
{% if deploy_adguard_virtual_ip['enable'] %}
keepalived:
image: ghcr.io/rmartin16/keepalived:latest
network_mode: host
environment:
INTERFACE: {{ deploy_adguard_virtual_ip['interface'] }}
VIRTUAL_IPS: {{ deploy_adguard_virtual_ip['vip_addr'] }}
STATE: "BACKUP"
cap_add:
- NET_ADMIN
{% endif %}
adguard:
image: adguard/adguardhome:latest
ports:
- "53:53/tcp"
- "53:53/udp"
{% if deploy_adguard_enable_admin_interface %}
- "80:80/tcp"
- "443:443/tcp"
- "3000:3000/tcp"
{% endif %}
{% if deploy_adguard_enable_dhcp %}
- "67:67/udp"
- "68:68/tcp"
- "68:68/udp"
{% endif %}
{% if deploy_adguard_enable_doh %}
- "443:443/udp"
{% endif %}
{% if deploy_adguard_enable_dot %}
- "853:853/tcp"
{% endif %}
{% if deploy_adguard_enable_doq %}
- "784:784/udp"
- "8853:8853/udp"
- "853:853/udp"
{% endif %}
{% if deploy_adguard_enable_dnscrypt %}
- "5443:5443/tcp"
- "5443:5443/udp"
{% endif %}
volumes:
- conf:/opt/adguardhome/conf
- data:/opt/adguardhome/work
networks:
- internal
{% if deploy_adguard_node_exporter %}
node_exporter:
image: ebrianne/adguard-exporter:latest
secrets:
- adguard_passw
environment:
adguard_protocol: {{ deploy_adguard_node_exporter['protocol'] }}
adguard_hostname: adguard
adguard_username: {{ deploy_adguard_node_exporter['username'] }}
adguard_password: /run/secrets/adguard_passw
adguard_port: {{ deploy_adguard_node_exporter['port'] }}
server_port: {{ deploy_adguard_node_exporter['exporter_port'] }}
interval: {{ deploy_adguard_node_exporter['interval'] }}
log_limit: {{ deploy_adguard_node_exporter['log_limit'] }}
password_from_file: true
ports:
- "9617:9617"
networks:
- internal
{% endif %}
networks:
internal:
driver: bridge
volumes:
conf:
driver_opts:
o: bind
device: {{ deploy_adguard_directory }}/conf
type: none
data:
driver_opts:
o: bind
device: {{ deploy_adguard_directory }}/data
type: none
secrets:
adguard_passw:
file: {{ deploy_adguard_directory }}/password