-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
47 lines (28 loc) · 1005 Bytes
/
Dockerfile
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
38
39
40
41
42
43
44
45
46
47
FROM node:18-buster AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig*.json ./
COPY ./packages/rabbykit/package.json ./packages/rabbykit/package.json
COPY ./site/doc/package.json ./site/doc/package.json
FROM base AS builder
ENV NODE_OPTIONS --max_old_space_size=4096
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . .
RUN pnpm build:doc
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/site/doc/public ./site/doc/public
RUN mkdir .next
RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/site/doc/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/site/doc/.next/static ./site/doc/.next/static
USER nextjs
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
CMD ["node", "./site/doc/server.js"]