Update Dockerfile
Browse files- Dockerfile +24 -38
Dockerfile
CHANGED
|
@@ -1,40 +1,26 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
# Create the /data directory with appropriate permissions
|
| 6 |
-
mkdir -p /data && chmod -R 777 /data && \
|
| 7 |
-
# Create the flowise directory with appropriate permissions
|
| 8 |
-
mkdir -p /usr/local/lib/node_modules/flowise && chmod -R 777 /usr/local/lib/node_modules/flowise && \
|
| 9 |
-
# Install dependencies
|
| 10 |
-
apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
|
| 11 |
-
# Switch to a non-root user for security
|
| 12 |
-
USER node
|
| 13 |
-
# Arguments that can be passed at build time and set them as environment variables
|
| 14 |
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
|
| 15 |
-
ARG BASE_PATH=/
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
# Clone the Flowise repository from GitHub
|
| 30 |
-
git clone https://github.com/FlowiseAI/Flowise.git . && \
|
| 31 |
-
# Install Flowise dependencies
|
| 32 |
-
pnpm install && \
|
| 33 |
-
# Build Flowise
|
| 34 |
-
pnpm build
|
| 35 |
-
# Set permissions and create directories
|
| 36 |
-
RUN sh -c 'mkdir -p $LOG_PATH && chmod -R 777 $LOG_PATH && \
|
| 37 |
-
mkdir -p $FLOWISE_PATH/uploads && chmod -R 777 $FLOWISE_PATH/uploads'
|
| 38 |
-
|
| 39 |
-
# Set the entry point to run Flowise
|
| 40 |
-
CMD pnpm start
|
|
|
|
| 1 |
+
FROM node:18-alpine
|
| 2 |
+
USER root
|
| 3 |
+
|
| 4 |
+
# Arguments that can be passed at build time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
|
| 6 |
+
ARG BASE_PATH=/root/.flowise
|
| 7 |
+
ARG DATABASE_PATH=$BASE_PATH
|
| 8 |
+
ARG SECRETKEY_PATH=$BASE_PATH
|
| 9 |
+
ARG LOG_PATH=$BASE_PATH/logs
|
| 10 |
+
ARG BLOB_STORAGE_PATH=$BASE_PATH/storage
|
| 11 |
+
|
| 12 |
+
# Install dependencies
|
| 13 |
+
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
|
| 14 |
+
|
| 15 |
+
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
| 16 |
+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
| 17 |
+
|
| 18 |
+
# Install Flowise globally
|
| 19 |
+
RUN npm install -g flowise
|
| 20 |
+
|
| 21 |
+
# Configure Flowise directories using the ARG
|
| 22 |
+
RUN mkdir -p $LOG_PATH $FLOWISE_PATH/uploads && chmod -R 777 $LOG_PATH $FLOWISE_PATH
|
| 23 |
+
|
| 24 |
+
WORKDIR /data
|
| 25 |
|
| 26 |
+
CMD ["npx", "flowise", "start"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|