Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

[WIP]Restart bug fix #163

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/core/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def run_container_with_retries(service_object):
f"traefik.http.routers.{service_id}.middlewares": f"{service_id}-strip-prefix",
}

restart_policy = {
"Name": "always",
}

container = client.containers.run(
service_object["downloadedDockerImage"],
command=service_object["command"],
Expand All @@ -225,6 +229,7 @@ def run_container_with_retries(service_object):
device_requests=device_requests,
labels=labels, # Add this line
network=config.DOCKER_NETWORK,
restart_policy=restart_policy,
)
logger.info(f"Started container {container.name}")

Expand Down