Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/ui-demo: Sets up Open WebUI #12

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ run-example-docker: example-models
-it \
nekko-api

run-demo: example-models
docker compose -f docker/web/docker-compose.yml up

example-models: models/SmolLM2-135M-Instruct-Q6_K.gguf models/Llama-3.2-1B-Instruct-Q5_K_S.gguf models/OLMo-7B-Instruct-hf-0724-Q4_K.gguf

models/SmolLM2-135M-Instruct-Q6_K.gguf:
Expand Down
2 changes: 2 additions & 0 deletions docker/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/ui/*
!/ui/.keep
26 changes: 26 additions & 0 deletions docker/web/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ services:
start_interval: 5s
retries: 5

ui:
image: ghcr.io/open-webui/open-webui:0.4.8
volumes:
- ./ui:/app/backend/data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we use named volume instead of bind volume? That way we won't leave garbage in the source tree (and will not accidentally include chat logs into docker image, as ui wasn't included into .dockerignore ;) ).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll change this to a bind volume. I've set it up this way because I like having easier access to volumes when debugging, but it's not needed here.

environment:
- WEBUI_AUTH=false
- WEBUI_NAME=NekkoAPI UI
- ENABLE_OLLAMA_API=false
- OPENAI_API_BASE_URL=http://nekko_api:8000/v1
networks:
- nekko_api-network
expose:
- 8080
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health"]
interval: 30s
timeout: 5s
start_period: 30s
start_interval: 5s
retries: 5
depends_on:
nekko_api:
condition: service_healthy

nginx:
platform: linux/amd64
image: nginx:alpine
Expand All @@ -37,6 +61,8 @@ services:
depends_on:
nekko_api:
condition: service_healthy
ui:
condition: service_healthy

networks:
nekko_api-network:
Expand Down
15 changes: 15 additions & 0 deletions docker/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,25 @@ http {
client_max_body_size 2M;

location / {
proxy_pass http://ui:8080;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location /v1 {
proxy_pass http://nekko_api:8000;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_read_timeout 20m;
}
}
}
Empty file added docker/web/ui/.keep
Empty file.
Loading