File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,11 +23,20 @@ COPY . .
2323RUN bun run --filter @sandchest/contract build && \
2424 bun run --filter @sandchest/api build
2525
26+ # Grab the Node.js binary for the runtime stage
27+ FROM node:22-slim AS node-bin
28+
2629FROM oven/bun:1.3.6-slim
2730WORKDIR /app
2831
2932ENV NODE_ENV=production
3033
34+ # Use Node.js runtime instead of Bun for @grpc/grpc-js TLS compatibility.
35+ # Bun's tls.connect polyfill doesn't properly handle secureContext with custom
36+ # CA certificates when upgrading existing sockets, causing gRPC mTLS to fail
37+ # with "unable to verify the first certificate".
38+ COPY --from=node-bin /usr/local/bin/node /usr/local/bin/node
39+
3140COPY package.json bun.lock ./
3241COPY apps/api/package.json apps/api/
3342COPY apps/admin/package.json apps/admin/
@@ -50,4 +59,4 @@ COPY --from=build /app/packages/contract/dist packages/contract/dist
5059COPY --from=build /app/packages/db/src packages/db/src
5160
5261EXPOSE 3001
53- CMD ["bun" , "run " , "apps/api/dist/index.js" ]
62+ CMD ["node " , "apps/api/dist/index.js" ]
You can’t perform that action at this time.
0 commit comments