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