Skip to content

Instantly share code, notes, and snippets.

@gngchrs
Last active February 9, 2024 13:22
Show Gist options
  • Save gngchrs/40a64df2c83744148877bfa428c34f48 to your computer and use it in GitHub Desktop.
Save gngchrs/40a64df2c83744148877bfa428c34f48 to your computer and use it in GitHub Desktop.
Ollama Web UI and Tailscale with https. The config file below goes in your config/config.json. Once you have these files do `docker compose up` and go to `https://ollama-ui.<tailnet>.ts.net. First request will take a little longer to load`
services:
ts-ollama-ui:
image: tailscale/tailscale:latest
container_name: ts-ollama-ui
hostname: ollama-ui # http://ollama-ui.<tailnet>.ts.net
extra_hosts:
- "host.docker.internal:host-gateway" # important for ollama web ui to communicate with ollama running locally
environment:
- TS_AUTHKEY=<YOUR_OAUTH_KEY / YOUR_AUTH_KEY >
- "TS_EXTRA_ARGS=--advertise-tags=tag:container --reset" ## only needed if you use YOUR_OAUTH_KEY with owner tags
- TS_SERVE_CONFIG=/config/config.json
- TS_STATE_DIR=/var/lib/tailscale
volumes:
- ${PWD}/state:/var/lib/tailscale
- ${PWD}/config:/config
- /dev/net/tun:/dev/net/tun
cap_add:
- NET_ADMIN
- SYS_MODULE
restart: unless-stopped
ollama-ui:
image: ghcr.io/ollama-webui/ollama-webui:main
container_name: ollama-ui
network_mode: service:ts-ollama-ui # where the magic happens
restart: always
volumes:
- ~/.ollama/ollama-webui:/app/backend/data
{
"TCP": {
"443": {
"HTTPS": true
}
},
"Web": {
"${TS_CERT_DOMAIN}:443": {
"Handlers": {
"/": {
"Proxy": "127.0.0.1:8080"
}
}
}
},
"AllowFunnel": {
"${TS_CERT_DOMAIN}:443": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment