-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.j2
33 lines (33 loc) · 1.16 KB
/
docker-compose.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
services:
{%- for scope, scopeDetails in scopes.items() %}
## {{ scope }}
{%- for name, details in scopeDetails.items() %}
{{ name }}:
image: {{ global.imageNamePrefix }}app-simulator-{{ scope }}-{{ details.type }}:{{global.imageVersion }}
{%- if details.exposedPort is defined %}
ports:
- "{{ details.exposedPort }}:{{ global.defaultPorts[scope] }}"
{%- endif %}
{%- if global.defaultPorts is defined -%}
{%- if global.defaultPorts[scope] is defined and global.defaultPorts[scope] != global._defaultDefaultPorts[scope] %}
environment:
- {{ scope | singularize | upper }}_DEFAULT_PORT={{ global.defaultPorts[scope] }}
{%- endif %}
{%- if global.defaultPorts[scope] <= 1024 %}
cap_add:
- NET_BIND_SERVICE
{%- endif %}
{%- endif %}
configs:
- source: {{ scope }}_{{ name | replace("-", "_") | lower }}_config
target: /config.json
{%- endfor %}
{%- endfor %}
configs:
{%- for scope, scopeDetails in scopes.items() %}
{%- for name, details in scopeDetails.items() %}
{{ scope }}_{{ name | replace("-", "_") | lower }}_config:
content: |
{{ details | tojson }}
{%- endfor -%}
{%- endfor %}