Skip to content

Commit 1ceafd1

Browse files
committed
fix: permissions in docker
1 parent 999e088 commit 1ceafd1

7 files changed

Lines changed: 27 additions & 17 deletions

File tree

docker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
2222
COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules
2323
COPY --from=build /usr/local/bin /usr/local/bin
2424

25+
RUN mkdir -p /home/node/.flowise && chown -R node:node /home/node/.flowise
26+
27+
USER node
28+
2529
ENTRYPOINT ["flowise", "start"]

docker/docker-compose-queue-prebuilt.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ services:
1919
ports:
2020
- '${PORT:-3000}:${PORT:-3000}'
2121
volumes:
22-
- ~/.flowise:/root/.flowise
22+
- ~/.flowise:/home/node/.flowise
2323
environment:
2424
# --- Essential Flowise Vars ---
2525
- PORT=${PORT:-3000}
26-
- DATABASE_PATH=${DATABASE_PATH:-/root/.flowise}
26+
- DATABASE_PATH=${DATABASE_PATH:-/home/node/.flowise}
2727
- DATABASE_TYPE=${DATABASE_TYPE}
2828
- DATABASE_PORT=${DATABASE_PORT}
2929
- DATABASE_HOST=${DATABASE_HOST}
@@ -180,11 +180,11 @@ services:
180180
container_name: flowise-worker
181181
restart: always
182182
volumes:
183-
- ~/.flowise:/root/.flowise
183+
- ~/.flowise:/home/node/.flowise
184184
environment:
185185
# --- Essential Flowise Vars ---
186186
- WORKER_PORT=${WORKER_PORT:-5566}
187-
- DATABASE_PATH=${DATABASE_PATH:-/root/.flowise}
187+
- DATABASE_PATH=${DATABASE_PATH:-/home/node/.flowise}
188188
- DATABASE_TYPE=${DATABASE_TYPE}
189189
- DATABASE_PORT=${DATABASE_PORT}
190190
- DATABASE_HOST=${DATABASE_HOST}

docker/docker-compose-queue-source.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ services:
2020
- '${PORT}:${PORT}'
2121
volumes:
2222
# Mount local .flowise to container's default location
23-
- ../.flowise:/root/.flowise
23+
- ../.flowise:/home/node/.flowise
2424
environment:
2525
# --- Essential Flowise Vars ---
2626
- PORT=${PORT:-3000}
27-
- DATABASE_PATH=/root/.flowise
28-
- SECRETKEY_PATH=/root/.flowise
29-
- LOG_PATH=/root/.flowise/logs
30-
- BLOB_STORAGE_PATH=/root/.flowise/storage
27+
- DATABASE_PATH=/home/node/.flowise
28+
- SECRETKEY_PATH=/home/node/.flowise
29+
- LOG_PATH=/home/node/.flowise/logs
30+
- BLOB_STORAGE_PATH=/home/node/.flowise/storage
3131
# --- Queue Vars (Main Instance) ---
3232
- MODE=queue
3333
- QUEUE_NAME=flowise-queue # Ensure this matches worker
@@ -44,14 +44,14 @@ services:
4444
dockerfile: docker/worker/Dockerfile # Ensure this path is correct
4545
volumes:
4646
# Mount same local .flowise to worker
47-
- ../.flowise:/root/.flowise
47+
- ../.flowise:/home/node/.flowise
4848
environment:
4949
# --- Essential Flowise Vars ---
5050
- WORKER_PORT=${WORKER_PORT:-5566} # Port for worker healthcheck
51-
- DATABASE_PATH=/root/.flowise
52-
- SECRETKEY_PATH=/root/.flowise
53-
- LOG_PATH=/root/.flowise/logs
54-
- BLOB_STORAGE_PATH=/root/.flowise/storage
51+
- DATABASE_PATH=/home/node/.flowise
52+
- SECRETKEY_PATH=/home/node/.flowise
53+
- LOG_PATH=/home/node/.flowise/logs
54+
- BLOB_STORAGE_PATH=/home/node/.flowise/storage
5555
# --- Queue Vars (Main Instance) ---
5656
- MODE=queue
5757
- QUEUE_NAME=flowise-queue # Ensure this matches worker

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,5 @@ services:
157157
retries: 5
158158
start_period: 30s
159159
volumes:
160-
- ~/.flowise:/root/.flowise
160+
- ~/.flowise:/home/node/.flowise
161161
entrypoint: /bin/sh -c "sleep 3; flowise start"

docker/worker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ COPY docker/worker/healthcheck/healthcheck.js .
3939
# Set the main working directory back
4040
WORKDIR /usr/src
4141

42+
RUN chown -R node:node /usr/src /app/healthcheck
43+
44+
USER node
45+
4246
# Environment variables for port configuration
4347
ENV WORKER_PORT=5566
4448

docker/worker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,5 @@ services:
156156
retries: 5
157157
start_period: 30s
158158
volumes:
159-
- ~/.flowise:/root/.flowise
159+
- ~/.flowise:/home/node/.flowise
160160
entrypoint: /bin/sh -c "node /app/healthcheck/healthcheck.js & sleep 5 && pnpm run start-worker"

packages/components/src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,7 @@ export const executeJavaScriptCode = async (
17711771
},
17721772
eval: false,
17731773
wasm: false,
1774+
fixAsync: true,
17741775
timeout: timeoutMs
17751776
}
17761777

@@ -1780,7 +1781,8 @@ export const executeJavaScriptCode = async (
17801781
...nodeVMOptions,
17811782
require: defaultNodeVMOptions.require,
17821783
eval: false,
1783-
wasm: false
1784+
wasm: false,
1785+
fixAsync: true
17841786
}
17851787

17861788
const vm = new NodeVM(finalNodeVMOptions)

0 commit comments

Comments
 (0)