fix(compose): made port expose optional
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
1
roles/docker_host/files/sysctl.conf
Normal file
1
roles/docker_host/files/sysctl.conf
Normal file
@@ -0,0 +1 @@
|
||||
vm.max_map_count = 262144
|
||||
@@ -30,7 +30,7 @@
|
||||
path: "{{ item }}"
|
||||
src: "192.168.20.12:{{ item }}"
|
||||
fstype: nfs
|
||||
opts: defaults,nolock
|
||||
opts: defaults,nolock,_netdev,auto,bg
|
||||
state: mounted
|
||||
loop:
|
||||
- /media/docker
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
networks:
|
||||
- net
|
||||
{% endif %}
|
||||
{% if service.ports is iterable %}
|
||||
{% if service.ports is defined and service.ports is iterable %}
|
||||
{% if service.ports[0].internal != 'proxy_only' %}
|
||||
ports:
|
||||
{% for port in service.ports %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user