-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (22 loc) · 800 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (22 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM node:24-alpine AS deps
WORKDIR /opt/5stack
COPY package.json yarn.lock .yarnrc.yml ./
RUN corepack enable && corepack prepare
RUN yarn install --immutable
FROM node:24-alpine AS builder
WORKDIR /opt/5stack
COPY --from=deps /opt/5stack/node_modules ./node_modules
COPY . .
RUN corepack enable && corepack prepare
# Node caps its default old-space at ~4GB, and this build peaks around 5.7GB
# (measured), so it OOMs with "Ineffective mark-compacts near heap limit".
# CI runners have 16GB, so give the build room instead of letting it run at
# the edge of the default ceiling.
ENV NODE_OPTIONS=--max-old-space-size=8192
RUN yarn build
FROM node:24-alpine
WORKDIR /opt/5stack
COPY --from=builder /opt/5stack/.output .
ENV HOST=0.0.0.0
EXPOSE 3000
CMD [ "node", "server/index.mjs" ]