Upload 3 files
Browse files- Dockerfile +65 -0
- README.md +64 -0
- flowise.json +12 -0
Dockerfile
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ---------- Base image -----------------------------------------------------
|
| 2 |
+
FROM node:18-slim
|
| 3 |
+
|
| 4 |
+
# ---------- OS packages ----------------------------------------------------
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
git python3 python3-pip build-essential \
|
| 7 |
+
libcairo2-dev libpango1.0-dev chromium curl \
|
| 8 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# ---------- Environment ----------------------------------------------------
|
| 11 |
+
ENV PUPPETEER_SKIP_DOWNLOAD=true \
|
| 12 |
+
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium \
|
| 13 |
+
CHROMA_SERVER_CORS_ALLOW_ORIGINS='["*"]' \
|
| 14 |
+
PORT=7860 \
|
| 15 |
+
FLOWISE_USERNAME=admin \
|
| 16 |
+
FLOWISE_PASSWORD=admin \
|
| 17 |
+
DATABASE_PATH=/data/.flowise \
|
| 18 |
+
LOG_PATH=/data/.flowise/logs \
|
| 19 |
+
TEMP_UPLOAD_DIR=/data/uploads \
|
| 20 |
+
CHROMA_URL=http://localhost:8000
|
| 21 |
+
|
| 22 |
+
# ---------- Node & Python deps --------------------------------------------
|
| 23 |
+
RUN npm install -g [email protected]
|
| 24 |
+
|
| 25 |
+
# Chroma server 1.x (compatible with Flowise v2 API)
|
| 26 |
+
RUN pip3 install numpy==1.26.4 --break-system-packages \
|
| 27 |
+
&& pip3 install chromadb==1.0.9 --break-system-packages # provides `chroma` CLI v2
|
| 28 |
+
|
| 29 |
+
# ---------- Prevent Flowise early-log crash -------------------------------
|
| 30 |
+
RUN mkdir -p /usr/local/lib/node_modules/flowise/logs \
|
| 31 |
+
&& chmod -R 777 /usr/local/lib/node_modules/flowise
|
| 32 |
+
|
| 33 |
+
# ---------- Persistent data directories -----------------------------------
|
| 34 |
+
WORKDIR /data
|
| 35 |
+
RUN mkdir -p /data/.flowise/logs /data/.flowise/storage /data/uploads /data/chroma \
|
| 36 |
+
&& chmod -R 777 /data \
|
| 37 |
+
&& chown -R 1000:1000 /data
|
| 38 |
+
ENV PATH=$PATH:/home/node/.local/bin:/usr/local/bin:/root/.local/bin
|
| 39 |
+
USER 1000:1000
|
| 40 |
+
|
| 41 |
+
# ---------- Expose ports ---------------------------------------------------
|
| 42 |
+
EXPOSE 7860 8000
|
| 43 |
+
|
| 44 |
+
# ---------- Start: Chroma ➜ wait ➜ Flowise ---------------------------------
|
| 45 |
+
CMD sh -c 'set -x; \
|
| 46 |
+
chroma run \
|
| 47 |
+
--path /data/chroma \
|
| 48 |
+
--host 0.0.0.0 \
|
| 49 |
+
--port 8000 \
|
| 50 |
+
& \
|
| 51 |
+
echo "--- Waiting for Chroma API ---"; \
|
| 52 |
+
while ! curl -v http://localhost:8000/api/v2/heartbeat; do \
|
| 53 |
+
echo "[DEBUG] Chroma not ready yet. Retrying..."; \
|
| 54 |
+
netstat -tulnp || ss -tulnp || true; \
|
| 55 |
+
sleep 1; \
|
| 56 |
+
done; \
|
| 57 |
+
echo "--- Chroma API is up ---"; \
|
| 58 |
+
echo "[DEBUG] Testing Chroma collections endpoint:"; \
|
| 59 |
+
curl -v http://localhost:8000/api/v2/collections || true; \
|
| 60 |
+
echo "[DEBUG] Environment variables:"; \
|
| 61 |
+
printenv | grep CHROMA || true; \
|
| 62 |
+
echo "[DEBUG] Process list:"; \
|
| 63 |
+
ps aux; \
|
| 64 |
+
echo "[DEBUG] Flowise will start now."; \
|
| 65 |
+
npx flowise start'
|
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Flowise
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
## 💾 Flowise on Hugging Face Spaces (with Chroma Persistence)
|
| 11 |
+
|
| 12 |
+
This Space uses **Flowise with local Chroma DB and SQLite** to store your documents and chat history.
|
| 13 |
+
|
| 14 |
+
> Once the container is running, access Flowise via the **App** tab above.
|
| 15 |
+
|
| 16 |
+
### 📍 What gets saved?
|
| 17 |
+
- **Uploaded documents and embeddings** → `/data/chroma`
|
| 18 |
+
- **Chat history and upsert logs** → `/data/flowise.db`
|
| 19 |
+
- **Configuration file** → `flowise.json`
|
| 20 |
+
|
| 21 |
+
These are stored in a special folder called `/data` which survives restarts but **not** rebuilds.
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## ⚠️ Do Not Edit or Rebuild
|
| 26 |
+
|
| 27 |
+
- Any code or README change deletes all your data.
|
| 28 |
+
- Do **not** commit changes once you’ve started using the Space.
|
| 29 |
+
- If you accidentally rebuild, all documents and work are lost.
|
| 30 |
+
- Rebuilds may also occur if Hugging Face updates backend infrastructure. Back up your data regularly.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## 🧱 How to Back Up Your Work
|
| 35 |
+
|
| 36 |
+
### ✅ Recommended Method: Export from Flowise UI
|
| 37 |
+
|
| 38 |
+
1. Open Flowise via the **App** tab.
|
| 39 |
+
2. Click the purple gear icon (top right) in your flow.
|
| 40 |
+
3. Choose **Export** to download the `.json` file to your device.
|
| 41 |
+
4. Unfortunately, for full data backups, you need to use a paid Hugging Face plan and mount external storage.
|
| 42 |
+
|
| 43 |
+
> Note: Runtime files (like `/data`) are not visible or downloadable from the Files tab in free-tier Docker Spaces.
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## 💡 Tip for Teams
|
| 48 |
+
|
| 49 |
+
- Back up your data **as soon as your bot is working**
|
| 50 |
+
- Re-upload documents only if necessary — rebuilding means starting over
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## 🛠 Version Info
|
| 55 |
+
|
| 56 |
+
- This setup uses **Flowise version 3.0.0**
|
| 57 |
+
- Compatibility may vary with later versions
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## ℹ️ Reference
|
| 62 |
+
|
| 63 |
+
Flowise Docs: https://docs.flowiseai.com/
|
| 64 |
+
Hugging Face Space Settings: https://huggingface.co/docs/hub/spaces
|
flowise.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"port": 7860,
|
| 3 |
+
"flowiseUsername": "admin",
|
| 4 |
+
"flowisePassword": "admin",
|
| 5 |
+
"databasePath": "/data/.flowise",
|
| 6 |
+
"logPath": "/data/.flowise/logs",
|
| 7 |
+
"tempUploadDir": "/data/uploads",
|
| 8 |
+
"chroma": {
|
| 9 |
+
"mode": "remote",
|
| 10 |
+
"url": "http://localhost:8000"
|
| 11 |
+
}
|
| 12 |
+
}
|