-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (28 loc) · 744 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
##### BASE
FROM node:18-bullseye-slim as base
RUN apt-get update || : && apt-get install python3 build-essential git -y
RUN npm i -g pnpm
##### DEPS
FROM base as deps
WORKDIR /app
ADD package.json pnpm-lock.yaml* ./
RUN pnpm i
##### BUILD
FROM deps as build
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production
ENV BUILD_STEP=1
RUN pnpm build
##### FINAL
FROM base
ENV NODE_ENV=production
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/next.config.js ./next.config.js
CMD ["pnpm", "start"]