Skip to content

Commit 7c63fe1

Browse files
committed
Use Node runtime for API Docker image
1 parent 992d0b4 commit 7c63fe1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/api/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,20 @@ COPY . .
2323
RUN 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+
2629
FROM oven/bun:1.3.6-slim
2730
WORKDIR /app
2831

2932
ENV 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+
3140
COPY package.json bun.lock ./
3241
COPY apps/api/package.json apps/api/
3342
COPY apps/admin/package.json apps/admin/
@@ -50,4 +59,4 @@ COPY --from=build /app/packages/contract/dist packages/contract/dist
5059
COPY --from=build /app/packages/db/src packages/db/src
5160

5261
EXPOSE 3001
53-
CMD ["bun", "run", "apps/api/dist/index.js"]
62+
CMD ["node", "apps/api/dist/index.js"]

0 commit comments

Comments
 (0)