-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
55 lines (25 loc) · 938 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
48
49
50
51
52
53
54
55
FROM node:14.19-alpine3.15 as DEPENDENCIES
WORKDIR /usr/app
COPY package.json package-lock.json ./
RUN npm install
FROM node:14.19-alpine3.15 as BUILDER_STEP
WORKDIR /usr/app
RUN apk update && apk add tzdata
ENV TZ America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY . .
COPY --from=DEPENDENCIES /usr/app/node_modules ./node_modules
RUN npm run build
FROM node:14.19-alpine3.15
WORKDIR /usr/app
RUN apk update && apk add tzdata
ENV TZ America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apk update && apk add vim
ENV NODE_ENV=production
COPY --from=BUILDER_STEP /usr/app/package.json ./package.json
COPY --from=BUILDER_STEP /usr/app/node_modules ./node_modules
COPY --from=BUILDER_STEP /usr/app/.next ./.next
COPY --from=BUILDER_STEP /usr/app/public ./public
EXPOSE 3000
CMD ["node_modules/.bin/next", "start"]