mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-01 18:25:01 -05:00
feat(turbo): restructured repo to be a standard turborepo monorepo (#341)
* added turborepo * finished turbo migration * updated gitignore * use dotenv & run format * fixed error in docs * remove standalone deployment in prod * fix ts error, remove ignore ts errors during build * added formatter to the end of the docs generator
This commit is contained in:
25
apps/sim/scripts/ollama_docker.sh
Executable file
25
apps/sim/scripts/ollama_docker.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Check that at least one argument is provided. If not, display the usage help.
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Usage: $(basename "$0") <ollama command> [args...]"
|
||||
echo "Example: $(basename "$0") ps # This will run 'ollama ps' inside the container"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Start a detached container from the ollama/ollama image,
|
||||
# mounting the host's ~/.ollama directory directly into the container.
|
||||
# Here we mount it to /root/.ollama, assuming that's where the image expects it.
|
||||
CONTAINER_ID=$(docker run -d -v ~/.ollama:/root/.ollama -p 11434:11434 ollama/ollama
|
||||
)
|
||||
|
||||
# Define a cleanup function to stop the container regardless of how the script exits.
|
||||
cleanup() {
|
||||
docker stop "$CONTAINER_ID" >/dev/null
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# Execute the command provided by the user within the running container.
|
||||
# The command runs as: "ollama <user-arguments>"
|
||||
docker exec -it "$CONTAINER_ID" ollama "$@"
|
||||
Reference in New Issue
Block a user