feat(docker): Move compose content to ansible group vars

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-01-17 01:31:10 +01:00
parent 1a1b8cb69c
commit e68d534e4f
7 changed files with 513 additions and 443 deletions

View File

@@ -4,9 +4,10 @@
}
{% for service in services %}
{% if service.ports is iterable %}
{{ service.name }}.{{ domain }} {
{% for vm in service.vm %}
reverse_proxy {{ hostvars[vm].ansible_host }}:{{ service.port }}
reverse_proxy {{ hostvars[vm].ansible_host }}:{{ service.ports | selectattr('name', 'equalto', 'http') | map(attribute='external') | first }}
{% endfor %}
log {
output file /var/log/caddy/{{ service.name }}.log
@@ -23,4 +24,5 @@
resolvers 1.1.1.1
}
}
{% endif %}
{% endfor %}