swadhinbiswas

[email protected]
2026-08-05 16:23:40 +0600 committed NaN years ago
beefd59
commit beefd59
1 file changed
+12 -7
Showing 1 changed file+12-7
▼Dockerfile.worker
+12-7
11
11
(echo "bun install attempt $i failed, retrying in 10s..." && sleep 10); \
12
12
done
13
13
14
+# Copy source into a staging layer so COPY --from has the files
15
+FROM base AS source
16
+COPY --from=deps /app/node_modules ./node_modules
17
+COPY . .
18
+
14
19
# Production image
15
20
FROM oven/bun:1 AS runner
16
21
WORKDIR /app
23
28
chown -R bun:bun /data
24
29
25
30
# Copy node_modules and source
26
-COPY --from=deps --chown=bun:bun /app/node_modules ./node_modules
27
-COPY --from=deps --chown=bun:bun /app/package.json ./
28
-COPY --from=deps --chown=bun:bun /app/cli ./cli
29
-COPY --from=deps --chown=bun:bun /app/tsconfig.json ./
31
+COPY --from=source --chown=bun:bun /app/node_modules ./node_modules
32
+COPY --from=source --chown=bun:bun /app/package.json ./
33
+COPY --from=source --chown=bun:bun /app/cli ./cli
34
+COPY --from=source --chown=bun:bun /app/tsconfig.json ./
30
35
31
36
# Copy source files needed for worker
32
-COPY --from=deps --chown=bun:bun /app/src/lib ./src/lib
33
-COPY --from=deps --chown=bun:bun /app/src/db ./src/db
34
-COPY --from=deps --chown=bun:bun /app/scripts/worker.ts ./scripts/worker.ts
37
+COPY --from=source --chown=bun:bun /app/src/lib ./src/lib
38
+COPY --from=source --chown=bun:bun /app/src/db ./src/db
39
+COPY --from=source --chown=bun:bun /app/scripts/worker.ts ./scripts/worker.ts
35
40
36
41
# Set environment variables
37
42
ENV NODE_ENV=production
38
43