blob: f1685f0bf7a79d7a589721b168384040efe1af46 [file] [log] [blame]
version: '{{ compose.version|default("3") }}'
{%- if compose.config|default({}) %}
configs:
{{ compose.config|yaml(False)|indent(2) }}
{%- endif %}
services:
{%- for name, srv in service.iteritems() %}
{%- set env_file_set = False %}
{{ name }}:
{%- if 'env_file' in srv.keys() %}{%- set env_file_set = True %}{%- endif %}
{{ srv|yaml(False)|indent(4) }}
{%- if not env_file_set and compose.environment is defined %}
env_file: .env
{%- endif %}
{%- endfor %}
{%- if volume|default({}) %}
volumes:
{%- for key, value in volume.iteritems() %}
{%- if value is mapping %}
{{ key }}:
{{ value|yaml(False)|indent(4) }}
{%- else %}
{{ key }}:
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if network|default({}) %}
networks:
{%- for key, value in network.iteritems() %}
{%- if value is mapping %}
{{ key }}:
{{ value|yaml(False)|indent(4) }}
{%- else %}
{{ key }}:
{%- endif %}
{%- endfor %}
{%- endif %}
{#-
vim: syntax=jinja
-#}