Flowise on Hugging Face. Persistent storage issues. #3708
Replies: 2 comments 10 replies
-
There are many FROM node:18-alpine
USER root
# Arguments that can be passed at build time
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
ARG BASE_PATH=/data/.flowise
ARG DATABASE_PATH=$BASE_PATH
ARG APIKEY_PATH=$BASE_PATH
ARG SECRETKEY_PATH=$BASE_PATH
ARG LOG_PATH=$BASE_PATH/logs
# Set the ARGs as ENV
ENV FLOWISE_PATH=$FLOWISE_PATH
ENV BASE_PATH=$BASE_PATH
ENV DATABASE_PATH=$DATABASE_PATH
ENV APIKEY_PATH=$APIKEY_PATH
ENV SECRETKEY_PATH=$SECRETKEY_PATH
ENV LOG_PATH=$LOG_PATH
# Install dependencies
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Install Flowise globally
RUN npm install -g flowise
# Configure Flowise directories using the ARG
RUN mkdir -p $FLOWISE_PATH/uploads /data && chmod -R 777 $FLOWISE_PATH /data
WORKDIR /data
CMD ["sh", "-c", "mkdir -p $LOG_PATH && chmod -R 777 $LOG_PATH && npx flowise start"] You just need to make sure securing access (if you want to deploy it for prod by using lower user permission, e.g add these lines at the end before running flowise): ...
# Switch to the non-root user
USER 1000
# Expose the Flowise port
EXPOSE 3000
.... |
Beta Was this translation helpful? Give feedback.
-
@SleepingSmel , as @bitsnaps mentioned, Hugging Face provides persistent storage, but you have to pay for it. If you don't want to pay and still want to use persistent storage, you can consider Aiven Cloud. They offer free PostgreSQL or MySQL databases. Simply create a free account on Aiven Cloud and select the SQL option. Afterward, enter the credentials (like host, port, and other details) in your configuration, and it should work fine. Please note that free services like Aiven Cloud are completely free, but if there is no activity for weeks or months, they may close your service. To address this, the best approach is to deploy a cron job that makes a single request to Hosted Flowise every 1-2 days. By doing this, your Hugging Face Space and persistent storage will run continuously without any issues. In fact, my Flowise setup has been working perfectly fine in production for the past six months without any problems. If you want, you can directly duplicate my space and use it for your own purposes by simply entering the necessary credentials. Here is my space: FlowiseAI on Hugging Face |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! Well, Hugging Face's server for Flowise is fantastic, it offers more free space and RAM than other paid options. However, there's no documentation on maintaining persistent storage across restarts. Even with the option to purchase a paid storage tier on HF, it doesn't work. Achieving this would make Flowise more accessible by preventing data loss during server updates. Thanks by advance!
Beta Was this translation helpful? Give feedback.
All reactions