fix(compose): made port expose optional

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-01-24 07:28:12 +01:00
parent ae929ca09d
commit 161e6446cd
4 changed files with 6 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
}
{% for service in services %}
{% if service.ports is defined %}
{% if service.ports is iterable %}
{% set http_port = service.ports | selectattr('name', 'equalto', 'http') | map(attribute='external') | list %}
{% if http_port %}
@@ -26,6 +27,8 @@
resolvers 1.1.1.1
}
}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}