Add support for docker-compose networks & container network
Signed-off-by: Simon Caron <simon.caron.8@gmail.com>
This commit is contained in:
parent
5eca1af323
commit
ec7c196064
@ -19,6 +19,18 @@ services:
|
|||||||
{% if container.network_mode is defined %}
|
{% if container.network_mode is defined %}
|
||||||
network_mode: {{ container.network_mode }}
|
network_mode: {{ container.network_mode }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if container.networks is defined %}
|
||||||
|
networks:
|
||||||
|
{% for network, params in container.networks.items() %}
|
||||||
|
{{ network }}:
|
||||||
|
{% if params.aliases is defined %}
|
||||||
|
aliases:
|
||||||
|
{% for alias in params.aliases %}
|
||||||
|
- {{ alias }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% if container.build is defined %}
|
{% if container.build is defined %}
|
||||||
build: {{ container.build }}
|
build: {{ container.build }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -204,3 +216,15 @@ services:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if networks is defined %}
|
||||||
|
networks:
|
||||||
|
{% for network in networks %}
|
||||||
|
{{ network.network_name }}:
|
||||||
|
{% if network.external is defined %}
|
||||||
|
external: {{ network.external }}
|
||||||
|
{% endif %}
|
||||||
|
{% if network.driver is defined %}
|
||||||
|
driver: {{ network.driver }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user