diff --git a/openwebui/.gitignore b/openwebui/.gitignore new file mode 100644 index 0000000..8424e78 --- /dev/null +++ b/openwebui/.gitignore @@ -0,0 +1,2 @@ +data/ +tailscale-data/ \ No newline at end of file diff --git a/openwebui/docker-compose.yml b/openwebui/docker-compose.yml new file mode 100644 index 0000000..f77a7f1 --- /dev/null +++ b/openwebui/docker-compose.yml @@ -0,0 +1,69 @@ +services: + tailscale-ingress: + image: tailscale/tailscale:latest + hostname: openwebui + environment: + - TS_AUTHKEY= + # - TS_EXTRA_ARGS=--advertise-tags=tag:container + - TS_SERVE_CONFIG=/config/ts-config.json + - TS_STATE_DIR=/var/lib/tailscale + volumes: + - ./tailscale-data:/var/lib/tailscale + - ./ts-config.json:/config/ts-config.json + devices: + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + restart: always + + ollama: + volumes: + - ./data/ollama:/root/.ollama + container_name: ollama + pull_policy: always + tty: true + #ports: + # - 11434:11434 + restart: always + devices: + - nvidia.com/gpu=all + image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest} + network_mode: service:tailscale-ingress + depends_on: + - tailscale-ingress + + open-webui: + build: + context: . + args: + OLLAMA_BASE_URL: '/ollama' + dockerfile: Dockerfile + image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main} + container_name: open-webui + volumes: + - ./data/open-webui:/app/backend/data + #ports: + # - 0.0.0.0:8080:8080 + environment: + - 'OLLAMA_BASE_URL=http://127.0.0.1:11434' + - ENABLE_FORWARD_USER_INFO_HEADERS=True + #- ENABLE_OTEL=true + #- ENABLE_OTEL_METRICS=true + #- OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317 + - "ENV=dev" + #extra_hosts: + # - host.docker.internal:host-gateway + restart: always + network_mode: service:tailscale-ingress + depends_on: + - tailscale-ingress + + otel-collector: + image: otel/opentelemetry-collector-contrib + volumes: + - ./otel-collector.yaml:/etc/otelcol-contrib/config.yaml + #ports: + # - "55678:55678" + network_mode: service:tailscale-ingress + depends_on: + - open-webui \ No newline at end of file diff --git a/openwebui/otel-collector.yaml b/openwebui/otel-collector.yaml new file mode 100644 index 0000000..26f3d48 --- /dev/null +++ b/openwebui/otel-collector.yaml @@ -0,0 +1,24 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + +exporters: + prometheus: + endpoint: 0.0.0.0:8889 + namespace: default + +processors: + batch: + +extensions: + health_check: + +service: + extensions: [health_check] + pipelines: + metrics: + receivers: [otlp] + processors: [batch] + exporters: [prometheus] \ No newline at end of file diff --git a/openwebui/ts-config.json b/openwebui/ts-config.json new file mode 100644 index 0000000..f54cd23 --- /dev/null +++ b/openwebui/ts-config.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://127.0.0.1:8080" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": false + } +} \ No newline at end of file