Add support for docker-compose networks & container network

Signed-off-by: Simon Caron <simon.caron.8@gmail.com>
This commit is contained in:
Simon Caron 2022-06-12 22:51:10 -04:00 committed by Corbin Bartsch
parent 5eca1af323
commit ec7c196064
Signed by: coredotbin
GPG Key ID: B03E030E4322E9D5

View File

@ -19,6 +19,18 @@ services:
{% if container.network_mode is defined %}
network_mode: {{ container.network_mode }}
{% 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 %}
build: {{ container.build }}
{% endif %}
@ -204,3 +216,15 @@ services:
{% endif %}
{% endif %}
{% 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 %}