kivilaid commited on
Commit
e8784c0
·
verified ·
1 Parent(s): dad9abd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -20
Dockerfile CHANGED
@@ -3,6 +3,7 @@ FROM node:20-alpine
3
  USER root
4
 
5
  # Arguments that can be passed at build time
 
6
  ARG BASE_PATH=/data/.flowise
7
  ARG DATABASE_PATH=$BASE_PATH
8
  ARG APIKEY_PATH=$BASE_PATH
@@ -10,45 +11,33 @@ ARG SECRETKEY_PATH=$BASE_PATH
10
  ARG LOG_PATH=$BASE_PATH/logs
11
 
12
  # Set the ARGs as ENV
 
13
  ENV BASE_PATH=$BASE_PATH
14
  ENV DATABASE_PATH=$DATABASE_PATH
15
  ENV APIKEY_PATH=$APIKEY_PATH
16
  ENV SECRETKEY_PATH=$SECRETKEY_PATH
17
  ENV LOG_PATH=$LOG_PATH
18
- # Set PORT for Hugging Face
19
- ENV PORT=7860
20
 
21
  # Install dependencies
22
- RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium curl cmake
23
 
24
  ENV PUPPETEER_SKIP_DOWNLOAD=true
25
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
26
- ENV NODE_OPTIONS=--max-old-space-size=4096
27
 
28
- # Set working directory
29
- WORKDIR /app
30
-
31
- # Clone your specific repository
32
  RUN git clone https://github.com/kivilaid/Flowise.git .
33
 
34
- # Install pnpm
35
- RUN npm install -g pnpm
36
 
37
- # Remove lockfile to avoid parsing issues
38
- RUN rm -f pnpm-lock.yaml
 
39
 
40
- # Install dependencies - skip optional dependencies that cause build issues
41
- RUN pnpm install --no-frozen-lockfile --no-optional
42
 
43
- # Build project
44
- RUN pnpm build
45
 
46
- # Create necessary directories
47
- RUN mkdir -p $BASE_PATH/logs $BASE_PATH/storage
48
- RUN chmod -R 777 $BASE_PATH
49
 
50
  # Set server bin as executable
51
  RUN chmod +x /app/packages/server/bin/run
52
 
53
- # Start command
54
  CMD ["sh", "-c", "mkdir -p $LOG_PATH && chmod -R 777 $LOG_PATH && cd /app/packages/server/bin && ./run start"]
 
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
 
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
  # Install dependencies
22
+ RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
23
 
24
  ENV PUPPETEER_SKIP_DOWNLOAD=true
25
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
 
26
 
 
 
 
 
27
  RUN git clone https://github.com/kivilaid/Flowise.git .
28
 
 
 
29
 
30
+ # Install Flowise globally
31
+ RUN npm install -g
32
+ RUN npm run build
33
 
 
 
34
 
35
+ # # Configure Flowise directories using the ARG
36
+ RUN mkdir -p $FLOWISE_PATH/uploads && chmod -R 777 $FLOWISE_PATH
37
 
 
 
 
38
 
39
  # Set server bin as executable
40
  RUN chmod +x /app/packages/server/bin/run
41
 
42
+
43
  CMD ["sh", "-c", "mkdir -p $LOG_PATH && chmod -R 777 $LOG_PATH && cd /app/packages/server/bin && ./run start"]