Skip to content

Commit 5db1bcf

Browse files
committed
fix Dockerfile
1 parent 1cd2b31 commit 5db1bcf

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

Dockerfile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,39 @@ WORKDIR /app
1111

1212
COPY package*.json pnpm-lock.yaml tsconfig.json tsup.config.ts ./
1313

14+
RUN pnpm install --frozen-lockfile
15+
1416
COPY src ./src
1517

1618
RUN pnpm approve-builds @swc/core esbuild lz4
1719

20+
RUN pnpm build
21+
22+
RUN pnpm prune --prod
23+
24+
# Runtime stage
25+
FROM base
26+
27+
# Install runtime dependencies for native modules
28+
RUN apk add --no-cache libc6-compat
29+
30+
WORKDIR /app
31+
32+
# Copy package files first
33+
COPY --from=builder /app/package.json ./package.json
34+
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
35+
36+
RUN pnpm approve-builds lz4
37+
1838
RUN pnpm install --prod --frozen-lockfile && \
19-
pnpm build && \
20-
pnpm prune --prod
39+
pnpm rebuild
2140

22-
COPY entrypoint.sh /entrypoint.sh
41+
COPY --from=builder /app/dist ./dist
2342

43+
COPY entrypoint.sh /entrypoint.sh
2444
RUN chmod +x /entrypoint.sh
2545

2646
EXPOSE 3000
2747

2848
ENTRYPOINT ["/entrypoint.sh"]
29-
CMD ["/bin/sh", "-c", "NODE_ENV=production PORT=3000 CONFIG_FILE=/config/env.yml CONTEXT_FILE=/config/context.md node dist/main.js"]
49+
CMD ["/bin/sh", "-c", "NODE_ENV=production PORT=3000 CONFIG_FILE=/config/env.yml CONTEXT_FILE=/config/context.md node dist/main.js"]

0 commit comments

Comments
 (0)