Skip to content

Commit 6c94bb1

Browse files
Agilulfo1820claude
andcommitted
fix: use multi-stage Docker build to prevent OOM during tsc
The @vechain/vebetterdao-contracts typechain types exhaust the default heap when compiling inside Alpine. Split into a builder stage with a 4GB heap limit and a slim runtime stage with production-only deps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d44cd6b commit 6c94bb1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
FROM node:20-alpine
1+
FROM node:20-alpine AS builder
22
WORKDIR /app
33
COPY package.json ./
4-
RUN npm install --production
4+
RUN npm install
55
COPY tsconfig.json ./
66
COPY src ./src
7-
RUN npx tsc
7+
RUN NODE_OPTIONS=--max-old-space-size=4096 npx tsc
8+
9+
FROM node:20-alpine
10+
WORKDIR /app
11+
COPY package.json ./
12+
RUN npm install --production
13+
COPY --from=builder /app/dist ./dist
814
ENV RELAYER_NETWORK=testnet-staging
915
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)