File size: 1,023 Bytes
3681061
 
 
0b7f5c8
 
 
 
651d960
 
 
 
 
2047b4c
0b7f5c8
 
 
 
 
 
 
3681061
 
 
 
 
 
0b7f5c8
8fb59d0
0b7f5c8
3681061
 
 
0b7f5c8
3681061
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Stage 1: Build stage
FROM node:20-alpine as build

USER root

# Arguments that can be passed at build time
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
ARG BASE_PATH=/root/.flowise
ARG DATABASE_PATH=$BASE_PATH
ARG APIKEY_PATH=$BASE_PATH
ARG SECRETKEY_PATH=$BASE_PATH
ARG LOG_PATH=$BASE_PATH/logs
ARG BLOB_STORAGE_PATH=$BASE_PATH/storage

ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Install Flowise globally
RUN npm install -g flowise

# Stage 2: Runtime stage
FROM node:20-alpine

# Install runtime dependencies
RUN apk add --no-cache chromium git python3 py3-pip make g++ build-base cairo-dev pango-dev

# Configure Flowise directories using the ARG
RUN mkdir -p $LOG_PATH $BLOB_STORAGE_PATH $FLOWISE_PATH/uploads && chmod -R 777 $LOG_PATH $BLOB_STORAGE_PATH $FLOWISE_PATH

# Copy Flowise from the build stage
COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=build /usr/local/bin /usr/local/bin

ENTRYPOINT ["flowise", "start"]