refactor: update run.sh

This commit is contained in:
Tanvir 2024-01-09 13:33:20 +06:00
parent f87a1c9543
commit 8bb68cfcae
No known key found for this signature in database
GPG key ID: 938B0F2643FE5107

18
run.sh
View file

@ -1,7 +1,17 @@
#!/bin/bash #!/bin/bash
docker build -t ollama-webui . image_name="ollama-webui"
docker stop ollama-webui || true container_name="ollama-webui"
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 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 docker image prune -f