Skip to content
Snippets Groups Projects
Commit ecfc9193 authored by ale's avatar ale
Browse files

Allow defining multiple container ports

parent d9dccc28
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ TimeoutStartSec=0
EnvironmentFile=-/etc/default/{{ service.name }}-{{ container.name }}
ExecStartPre=/usr/bin/docker pull {{ container.image }}
# Minimum set: --cgroups name=systemd
ExecStart=/usr/bin/systemd-docker --env run --rm --name {{ service.name }}-{{ container.name }} {% if container.resources is defined %}{% if container.resources.ram is defined %}--memory={{ container.resources.ram }}{% endif %} {% if container.resources.cpu is defined %}--cpus={{ container.resources.cpu }}{% endif %}{% endif %} --network host --expose {{ container.port }} --mount type=bind,source=/dev/log,destination=/dev/log {% for creds in service.get('service_credentials', []) %} --mount type=bind,source=/etc/credentials/x509/{{ creds.name }},destination=/etc/credentials/x509/{{ creds.name }}{% endfor %} {% for mount in container.get('volumes', []) %} --mount type=bind{% for k, v in mount.iteritems() %},src={{ k }},dst={{ v }}{% endfor %}{% endfor %} {{ container.get('docker_options', '') }} {{ container.image }} {{ container.get('args', '') }}
ExecStart=/usr/bin/systemd-docker --env run --rm --name {{ service.name }}-{{ container.name }} {% if container.resources is defined %}{% if container.resources.ram is defined %}--memory={{ container.resources.ram }}{% endif %} {% if container.resources.cpu is defined %}--cpus={{ container.resources.cpu }}{% endif %}{% endif %} --network host {% if container.get('ports', []) %}--expose {{ container.ports | join(',') }} {% else %}--expose {{ container.port }}{% endif %} --mount type=bind,source=/dev/log,destination=/dev/log {% for creds in service.get('service_credentials', []) %} --mount type=bind,source=/etc/credentials/x509/{{ creds.name }},destination=/etc/credentials/x509/{{ creds.name }}{% endfor %} {% for mount in container.get('volumes', []) %} --mount type=bind{% for k, v in mount.iteritems() %},src={{ k }},dst={{ v }}{% endfor %}{% endfor %} {{ container.get('docker_options', '') }} {{ container.image }} {{ container.get('args', '') }}
Restart=always
RestartSec=10s
Type=notify
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment