forked from line/abc-user-feedback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 797 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
# Build stage
FROM node:16-alpine AS builder
WORKDIR /pre
ENV NODE_OPTIONS="–max_old_space_size=4096"
ENV NEXT_TELEMETRY_DISABLED 1
RUN apk --no-cache add --virtual builds-deps build-base python3
COPY . .
RUN yarn --frozen-lockfile
RUN yarn build:server
RUN yarn build:client
RUN yarn install --production --ignore-scripts --prefer-offline
# Runtime stage
FROM node:16-alpine
WORKDIR /usr/app
ENV NODE_ENV production
COPY --from=builder /pre/public ./public
COPY --from=builder /pre/next-i18next.config.js ./next-i18next.config.js
COPY --from=builder /pre/dist ./dist
COPY --from=builder /pre/template ./template
COPY --from=builder /pre/.next ./.next
COPY --from=builder /pre/node_modules ./node_modules
COPY --from=builder /pre/package.json ./package.json
EXPOSE 3000
CMD yarn start