blob: c444427d9a4ee6d3a987bc2bc56672c6e886a22d [file] [log] [blame]
{% for container_name, container in containers.iteritems() %}
{{ container_name}}:
# container_name: {{ container.container_base_name }}_{{ container_name }}_1
image: {{ container.image }}
{%- if container.command %}
command: {{ container.command }}
{%- endif %}
{%- if container.ports %}
ports:
{%- for src,dest in container.ports.iteritems() %}
- "{{ src }}:{{ dest }}"
{%- endfor %}
{%- endif %}
{%- if container.links %}
links:
{%- for link in container.links %}
- {{ link }}
{%- endfor %}
{%- endif %}
{%- if container.volumes %}
{%- for volume in container.volumes %}
volumes:
{%- if volume.read_only %}
- {{ volume.host_path }}:{ volume.container_path }}:ro
{%- else %}
- {{ volume.host_path }}:{ volume.container_path }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if container.expose %}
expose:
{%- for expose in container.expose %}
- "{{ expose }}"
{%- endfor %}
{%- endif %}
log_driver: "json-file"
log_opt:
max-size: "100k"
max-file: "5"
{%- endfor %}