fix(port mapping,docker): fixed duplicate port mapping on hosts and incompatible docker options in compose
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -5,9 +5,11 @@
|
||||
|
||||
{% for service in services %}
|
||||
{% if service.ports is iterable %}
|
||||
{% set http_port = service.ports | selectattr('name', 'equalto', 'http') | map(attribute='external') | list %}
|
||||
{% if http_port %}
|
||||
{{ service.name }}.{{ domain }} {
|
||||
{% for vm in service.vm %}
|
||||
reverse_proxy {{ hostvars[vm].ansible_host }}:{{ service.ports | selectattr('name', 'equalto', 'http') | map(attribute='external') | first }}
|
||||
reverse_proxy {{ hostvars[vm].ansible_host }}:{{ http_port[0] }}
|
||||
{% endfor %}
|
||||
log {
|
||||
output file /var/log/caddy/{{ service.name }}.log
|
||||
@@ -25,4 +27,5 @@
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user