diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..cbcc41d9 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +install: + @docker-compose up -d + +remove: + @chmod +x confirm_remove.sh + @./confirm_remove.sh + + +start: + @docker-compose start + +stop: + @docker-compose stop + +update: + # Calls the LLM update script + chmod +x update_ollama_models.sh + @./update_ollama_models.sh + @git pull + @docker-compose down + # Make sure the ollama-webui container is stopped before rebuilding + @docker stop open-webui || true + @docker-compose up --build -d + @docker-compose start + diff --git a/confirm_remove.sh b/confirm_remove.sh new file mode 100755 index 00000000..729c2507 --- /dev/null +++ b/confirm_remove.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Warning: This will remove all containers and volumes, including persistent data. Do you want to continue? [Y/N]" +read ans +if [ "$ans" == "Y" ] || [ "$ans" == "y" ]; then + docker-compose down -v +else + echo "Operation cancelled." +fi diff --git a/update_ollama_models.sh b/update_ollama_models.sh new file mode 100644 index 00000000..bde11b4b --- /dev/null +++ b/update_ollama_models.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# update_llm.sh + +# Retrieves the list of LLMs installed in the Docker container +llm_list=$(docker exec ollama ollama list | tail -n +2 | awk '{print $1}') + +# Loop over each LLM to update it +for llm in $llm_list; do + docker exec ollama ollama pull $llm +done