Skip to content

Commit 44d2adc

Browse files
committed
update worker Dockerfile
1 parent 72abcdf commit 44d2adc

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
context: .
9494
file: |
9595
${{
96-
steps.defaults.outputs.image_type == 'worker' && 'docker/worker/Dockerfile.worker' ||
96+
steps.defaults.outputs.image_type == 'worker' && 'docker/worker/Dockerfile' ||
9797
(steps.defaults.outputs.registry == 'docker_hub' && './docker/Dockerfile' || 'Dockerfile')
9898
}}
9999
build-args: |

docker/worker/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM node:20-alpine
2+
3+
RUN apk add --update libc6-compat python3 make g++
4+
# needed for pdfjs-dist
5+
RUN apk add --no-cache build-base cairo-dev pango-dev
6+
7+
# Install Chromium
8+
RUN apk add --no-cache chromium curl
9+
10+
#install PNPM globaly
11+
RUN npm install -g pnpm
12+
13+
ENV PUPPETEER_SKIP_DOWNLOAD=true
14+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
15+
16+
ENV NODE_OPTIONS=--max-old-space-size=8192
17+
18+
WORKDIR /usr/src
19+
20+
# Copy app source
21+
COPY . .
22+
23+
RUN pnpm install
24+
25+
RUN pnpm build
26+
27+
# --- Healthcheck Setup ---
28+
WORKDIR /app/healthcheck
29+
30+
COPY docker/worker/healthcheck/package.json .
31+
32+
RUN npm install --omit=dev
33+
34+
COPY docker/worker/healthcheck/healthcheck.js .
35+
36+
# --- End Healthcheck Setup ---
37+
38+
# Set the main working directory back
39+
WORKDIR /usr/src
40+
41+
EXPOSE 3000
42+
43+
# Start healthcheck in background and flowise in foreground
44+
CMD ["/bin/sh", "-c", "node /app/healthcheck/healthcheck.js & sleep 5 && pnpm run start-worker"]

0 commit comments

Comments
 (0)