Skip to content

Instantly share code, notes, and snippets.

@Tedfulk
Created February 28, 2024 17:57
Show Gist options
  • Save Tedfulk/31ddb1f1ea441951947c2d5ce1fef18a to your computer and use it in GitHub Desktop.
Save Tedfulk/31ddb1f1ea441951947c2d5ce1fef18a to your computer and use it in GitHub Desktop.
ubuntu fish function to quickly get a the docker container running lobechat working.
function lobe_chat
# Check if Ollama serve is running on port 11434
if not netstat -tuln | grep -q 11434
echo "Starting Ollama serve..."
# Assuming ollama serve is the correct command to start the server
ollama serve &
else
echo "Ollama serve is already running."
end
# Check if the Docker container named inspiring_matsumoto is running
set container_status (docker ps --filter "name=inspiring_matsumoto" --format "{{.Names}}")
if test -z "$container_status"
echo "Starting Docker container inspiring_matsumoto..."
docker start inspiring_matsumoto
else
docker restart inspiring_matsumoto
echo "Docker container inspiring_matsumoto is already running. But I'm going to restart it anyways and start fresh."
end
# Create an SSH tunnel
echo "Creating SSH tunnel..."
sudo ssh -L 3210:localhost:3210 ted@192.168.0.94 -N &
echo "SSH tunnel created. You can now access the application via http://localhost:3210/."
end
# To update the docker image: this may be wrong, next time I want to update I'll come back and fix this if need be.
# docker stop <container-name>
# docker rm <container-name>
# docker run -d --network="host" -e OLLAMA_PROXY_URL=http://localhost:11434/v1 lobehub/lobe-chat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment