generated from OneGraph/oneblog
-
Notifications
You must be signed in to change notification settings - Fork 11
/
dockerfile
37 lines (24 loc) · 575 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
FROM node:14 as builder
COPY package.json .
COPY yarn.lock .
COPY .env .
RUN yarn install
COPY . .
ENV NODE_ENV=production
RUN yarn build && rm -rf .next/cache
# Make smaller prod image
FROM node:14 as node_installer
ENV NODE_ENV=production
COPY package.json .
COPY yarn.lock .
RUN yarn install --production
FROM node:14
ENV NODE_ENV=production
COPY package.json .
COPY yarn.lock .
COPY .env .
COPY server.js.example server.js
COPY next.config.js .
COPY --from=builder .next .next
COPY --from=node_installer node_modules node_modules
CMD [ "node", "server.js" ]