blob: faa9d02e858b297e28ca9d3345238f8ba7a7aa59 [file] [log] [blame]
Scott Bakere1dc6f92016-06-03 16:32:45 -07001{% for container_name, container in containers.iteritems() %}
2
3{{ container_name}}:
Scott Bakera93e5962016-06-07 09:03:09 -07004# container_name: {{ container.container_base_name }}_{{ container_name }}_1
Scott Bakere1dc6f92016-06-03 16:32:45 -07005 image: {{ container.image }}
6{%- if container.command %}
7 command: {{ container.command }}
8{%- endif %}
9{%- if container.ports %}
10 ports:
11{%- for src,dest in container.ports.iteritems() %}
12 - "{{ src }}:{{ dest }}"
13{%- endfor %}
14{%- endif %}
15{%- if container.links %}
Scott Bakera93e5962016-06-07 09:03:09 -070016 links:
Scott Bakere1dc6f92016-06-03 16:32:45 -070017{%- for link in container.links %}
18 - {{ link }}
19{%- endfor %}
20{%- endif %}
Scott Bakerb3dcdb42016-06-09 16:11:45 -070021{%- if container.external_links %}
22 external_links:
23{%- for link in container.external_links %}
24 - {{ link }}
25{%- endfor %}
26{%- endif %}
Scott Bakere1dc6f92016-06-03 16:32:45 -070027{%- if container.volumes %}
Scott Bakere1dc6f92016-06-03 16:32:45 -070028 volumes:
Scott Baker393e3172016-06-07 10:20:00 -070029{%- for volume in container.volumes %}
Scott Bakere1dc6f92016-06-03 16:32:45 -070030{%- if volume.read_only %}
Scott Baker393e3172016-06-07 10:20:00 -070031 - {{ volume.host_path }}:{{ volume.container_path }}:ro
Scott Bakere1dc6f92016-06-03 16:32:45 -070032{%- else %}
Scott Baker393e3172016-06-07 10:20:00 -070033 - {{ volume.host_path }}:{{ volume.container_path }}
Scott Bakere1dc6f92016-06-03 16:32:45 -070034{%- endif %}
35{%- endfor %}
36{%- endif %}
37{%- if container.expose %}
38 expose:
39{%- for expose in container.expose %}
40 - "{{ expose }}"
41{%- endfor %}
42{%- endif %}
Scott Baker0f1054d2016-06-06 10:40:40 -070043 log_driver: "json-file"
44 log_opt:
45 max-size: "100k"
46 max-file: "5"
Scott Bakere1dc6f92016-06-03 16:32:45 -070047
48{%- endfor %}