Spaces:
Sleeping
Sleeping
Automated deployment update from ML build
Browse files- Dockerfile +27 -0
- README.md +41 -5
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/open-webui/open-webui:main
|
| 2 |
+
|
| 3 |
+
# 1. Hugging Face Spaces require the container to listen on Port 7860
|
| 4 |
+
ENV PORT=7860
|
| 5 |
+
EXPOSE 7860
|
| 6 |
+
|
| 7 |
+
# 2. Point Open WebUI directly to your LiteLLM gateway
|
| 8 |
+
ENV OPENAI_API_BASE_URL=https://samuellance73-mldemo.hf.space/v1
|
| 9 |
+
ENV OPENAI_API_KEY=none
|
| 10 |
+
|
| 11 |
+
# 3. Disable local authentication (using open/unprotected gateway)
|
| 12 |
+
ENV WEBUI_AUTH=False
|
| 13 |
+
|
| 14 |
+
# 4. Inject static security keys so the container never has to write them to disk on boot
|
| 15 |
+
ENV WEBUI_SECRET_KEY=sanctuary_covert_vault_secret_key_99
|
| 16 |
+
ENV OAUTH_SESSION_TOKEN_ENCRYPTION_KEY=sanctuary_oauth_token_encryption_key_99_secure_bytes
|
| 17 |
+
|
| 18 |
+
# 5. FIX ALL PERMISSIONS: Switch to root to configure the entire app directory for UID 1000
|
| 19 |
+
USER root
|
| 20 |
+
|
| 21 |
+
# Grant full ownership and write permissions of the entire application directory to the HF user (1000)
|
| 22 |
+
RUN mkdir -p /app/backend/data && \
|
| 23 |
+
chown -R 1000:1000 /app && \
|
| 24 |
+
chmod -R 777 /app
|
| 25 |
+
|
| 26 |
+
# 6. Switch back to the unprivileged Hugging Face user (UID 1000) for execution
|
| 27 |
+
USER 1000
|
README.md
CHANGED
|
@@ -1,10 +1,46 @@
|
|
| 1 |
---
|
| 2 |
-
title: Open
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Open WebUI
|
| 3 |
+
emoji: π€
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Sanctuary Web UI
|
| 12 |
+
|
| 13 |
+
This directory contains the standalone web interface configuration for the Sanctuary monorepo.
|
| 14 |
+
|
| 15 |
+
It is designed to deploy **Open WebUI** directly to a Hugging Face Space as a Docker container, acting as a clean, elegant frontend.
|
| 16 |
+
|
| 17 |
+
## Architecture
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
Sanctuary/
|
| 21 |
+
βββ main/ <βββ Backend ML & deployment configuration
|
| 22 |
+
βββ web-ui/ <βββ Standalone frontend configuration (this folder)
|
| 23 |
+
βββ Dockerfile <βββ Port-configured Open WebUI Docker image
|
| 24 |
+
βββ README.md <βββ Hugging Face Space metadata and documentation
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
By decoupling the web UI configuration from the backend Python scripts and custom obfuscation logic, we achieve:
|
| 28 |
+
1. **Separation of Concerns**: The Python code remains 100% focused on core backend tasks, free from UI configs.
|
| 29 |
+
2. **Independent Scalability**: Changes to the web UI config do not trigger backend rebuilds.
|
| 30 |
+
3. **Clean Monorepo Layout**: Keeps physical files distinct while maintaining unified history and node configurations.
|
| 31 |
+
|
| 32 |
+
## Local Configuration
|
| 33 |
+
|
| 34 |
+
The parent deployment pipeline manages this directory using the `custom-dir` parameter in `main/manifests/nodes.yaml`:
|
| 35 |
+
|
| 36 |
+
```yaml
|
| 37 |
+
web-ui:
|
| 38 |
+
hf-repo: "samuellance73/open-webui"
|
| 39 |
+
token-env: "HF1"
|
| 40 |
+
create-repo: true
|
| 41 |
+
space-sdk: docker
|
| 42 |
+
repo-type: space
|
| 43 |
+
custom-dir: "../web-ui"
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
When `deploy.py` is invoked, it resolves the relative path `../web-ui` from `main/` and uploads this configuration directly to the target space repository.
|