kivilaid commited on
Commit
3696652
·
verified ·
1 Parent(s): 7d3df69

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -34
Dockerfile CHANGED
@@ -1,44 +1,25 @@
1
- FROM node:20-alpine
 
2
 
3
  USER root
4
 
5
- # Arguments that can be passed at build time
6
- ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
7
- ARG BASE_PATH=/data/.flowise
8
- ARG DATABASE_PATH=$BASE_PATH
9
- ARG APIKEY_PATH=$BASE_PATH
10
- ARG SECRETKEY_PATH=$BASE_PATH
11
- ARG LOG_PATH=$BASE_PATH/logs
12
-
13
- # Set the ARGs as ENV
14
- ENV FLOWISE_PATH=$FLOWISE_PATH
15
- ENV BASE_PATH=$BASE_PATH
16
- ENV DATABASE_PATH=$DATABASE_PATH
17
- ENV APIKEY_PATH=$APIKEY_PATH
18
- ENV SECRETKEY_PATH=$SECRETKEY_PATH
19
- ENV LOG_PATH=$LOG_PATH
20
-
21
- RUN git clone https://github.com/kivilaid/Flowise.git .
22
-
23
- # Install dependencies
24
- RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
25
-
26
  ENV PUPPETEER_SKIP_DOWNLOAD=true
27
- ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
28
 
 
 
29
 
 
 
30
 
31
- # Install Flowise globally
32
- RUN npm install -g
33
- RUN npm run build
34
-
35
-
36
- # # Configure Flowise directories using the ARG
37
- RUN mkdir -p $FLOWISE_PATH/uploads && chmod -R 777 $FLOWISE_PATH
38
-
39
 
40
- # Set server bin as executable
41
- RUN chmod +x /app/packages/server/bin/run
42
 
 
 
 
43
 
44
- CMD ["sh", "-c", "mkdir -p $LOG_PATH && chmod -R 777 $LOG_PATH && cd /app/packages/server/bin && ./run start"]
 
1
+ # Stage 1: Build stage
2
+ FROM node:20-alpine AS build
3
 
4
  USER root
5
 
6
+ # Skip downloading Chrome for Puppeteer (saves build time)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ENV PUPPETEER_SKIP_DOWNLOAD=true
 
8
 
9
+ # Install latest Flowise globally (specific version can be set: flowise@1.0.0)
10
+ RUN npm install -g flowise
11
 
12
+ # Stage 2: Runtime stage
13
+ FROM node:20-alpine
14
 
15
+ # Install runtime dependencies
16
+ RUN apk add --no-cache chromium git python3 py3-pip make g++ build-base cairo-dev pango-dev curl
 
 
 
 
 
 
17
 
18
+ # Set the environment variable for Puppeteer to find Chromium
19
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
20
 
21
+ # Copy Flowise from the build stage
22
+ COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules
23
+ COPY --from=build /usr/local/bin /usr/local/bin
24
 
25
+ ENTRYPOINT ["flowise", "start"]