lvkxe commited on
Commit
82eb65e
Β·
verified Β·
1 Parent(s): 3512305

Upload 3 files

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