Skip to content

Commit 9d289ab

Browse files
feat: setup worker service with configuration and entry point
1 parent 03f1359 commit 9d289ab

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

apps/worker/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM node:20-alpine AS base
2+
WORKDIR /app
3+
4+
FROM base AS deps
5+
COPY package.json package-lock.json turbo.json ./
6+
COPY packages/shared/package.json packages/shared/
7+
COPY packages/db/package.json packages/db/
8+
COPY packages/queue/package.json packages/queue/
9+
COPY apps/worker/package.json apps/worker/
10+
RUN npm ci
11+
12+
FROM base AS builder
13+
COPY --from=deps /app/node_modules ./node_modules
14+
COPY . .
15+
RUN npx turbo run build --filter=@taskflow/worker
16+
17+
FROM base AS runner
18+
ENV NODE_ENV=production
19+
COPY --from=builder /app/node_modules ./node_modules
20+
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist
21+
COPY --from=builder /app/packages/shared/package.json ./packages/shared/
22+
COPY --from=builder /app/packages/db/dist ./packages/db/dist
23+
COPY --from=builder /app/packages/db/package.json ./packages/db/
24+
COPY --from=builder /app/packages/queue/dist ./packages/queue/dist
25+
COPY --from=builder /app/packages/queue/package.json ./packages/queue/
26+
COPY --from=builder /app/apps/worker/dist ./apps/worker/dist
27+
COPY --from=builder /app/apps/worker/package.json ./apps/worker/
28+
29+
CMD ["node", "apps/worker/dist/index.js"]

0 commit comments

Comments
 (0)