From 8bb68cfcaece11ce9fca34dc39d3a4f82e7bd54d Mon Sep 17 00:00:00 2001 From: Tanvir Date: Tue, 9 Jan 2024 13:33:20 +0600 Subject: [PATCH] refactor: update run.sh --- run.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/run.sh b/run.sh index 3abc5f036..3fb41d933 100644 --- a/run.sh +++ b/run.sh @@ -1,7 +1,17 @@ #!/bin/bash -docker build -t ollama-webui . -docker stop ollama-webui || true -docker rm ollama-webui || true -docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v ollama-webui:/app/backend/data --name ollama-webui --restart always ollama-webui -docker image prune -f \ No newline at end of file +image_name="ollama-webui" +container_name="ollama-webui" + +docker build -t "$image_name" . +docker stop "$container_name" &>/dev/null || true +docker rm "$container_name" &>/dev/null || true + +docker run -d -p 3000:8080 \ + --add-host=host.docker.internal:host-gateway \ + -v "${image_name}:/app/backend/data" \ + --name "$container_name" \ + --restart always \ + "$image_name" + +docker image prune -f