Jae014 commited on
Commit
7797fb4
·
verified ·
1 Parent(s): af13c35

Upload 3 files

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