-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
57 lines (41 loc) · 1.23 KB
/
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
48
49
50
51
52
53
54
55
56
57
ARG node_image=node:18-alpine3.15
# STAGE 1
FROM $node_image as builder
ENV NEXT_TELEMETRY_DISABLED=1
WORKDIR /app/
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --no-progress --ignore-scripts
COPY next.config.js ./
COPY next-i18next.config.js ./
COPY tsconfig.json ./
COPY api-framework ./api-framework/
COPY components ./components/
COPY globals ./globals/
COPY pages ./pages/
COPY proxy ./proxy/
COPY public ./public/
COPY server-side ./server-side/
COPY styles ./styles/
COPY theme ./theme/
RUN yarn build
# STAGE 2 -- useful if we don't want to include dependencies that
# are used as apart of the build process
FROM $node_image as production
WORKDIR /app/
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production --no-progress --ignore-scripts
# STAGE 3
FROM $node_image
RUN apk update && apk upgrade
RUN npm uninstall npm -g
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
WORKDIR /app/
COPY --from=production /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/next-i18next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./
EXPOSE 3000
CMD yarn start