diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index e2156c6..684e5b7 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -72,12 +72,19 @@ services: {% endfor %} {% endif %} {% if container.labels is defined %} +{% if container.labels is none %} + labels: [] +{% else %} labels: {% for label in container.labels %} - {{ label }} {% endfor %} {% endif %} +{% endif %} {% if container.ports is defined %} +{% if container.ports is none %} + ports: [] +{% else %} ports: {% for port in container.ports %} - {{ port }}