From 20a85958d29dbbdcd0e59c715556bd8575be9482 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 15 Jan 2019 10:04:35 +0100 Subject: [PATCH] new: add restart policy 'unless-stopped' to services. --- bin/compose-core | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/compose-core b/bin/compose-core index a45689d..3d0f2f9 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -2829,6 +2829,11 @@ _get_docker_compose_mixin_from_metadata_cached() { mixins+=("volumes:"$'\n'"$volumes") fi + type="$(printf "%s" "$metadata" | shyaml get-value type 2>/dev/null)" || true + if [ "$type" != "run-once" ]; then + mixins+=("restart: unless-stopped") + fi + docker_compose=$(printf "%s" "$metadata" | shyaml get-value -y "docker-compose" 2>/dev/null) || true if [ "$docker_compose" ]; then mixins+=("$docker_compose")