-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (25 loc) · 858 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (25 loc) · 858 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
FROM node:24-bookworm-slim AS builder
ENV PNPM_HOME=/pnpm
ENV PATH=$PNPM_HOME:$PATH
WORKDIR /app
RUN corepack enable
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
ENV SITE_URL=https://termui.rs
RUN --mount=type=cache,id=termui-pnpm-store,target=/pnpm/store \
pnpm install --frozen-lockfile \
&& pnpm build:production
FROM node:24-bookworm-slim AS runner
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
HOSTNAME=0.0.0.0 \
PORT=3000
RUN groupadd --system --gid 1001 termui \
&& useradd --system --uid 1001 --gid termui --home-dir /app --shell /usr/sbin/nologin termui
COPY --from=builder --chown=termui:termui /app/public ./public
COPY --from=builder --chown=termui:termui /app/.next/standalone ./
COPY --from=builder --chown=termui:termui /app/.next/static ./.next/static
USER termui
EXPOSE 3000
CMD ["node", "server.js"]