-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (27 loc) · 807 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
FROM node:18 AS builder
LABEL builder=true
RUN npm install -g [email protected]
RUN npm install -g [email protected]
COPY ./src /workdir/src
WORKDIR /workdir/src
RUN yarn install
# for e2e test by playwright
RUN yarn playwright install-deps
# for prisma type generation
RUN prisma generate
# build project
RUN yarn build
RUN apt update -y
# for visualizing project dependency
RUN apt install graphviz -y
FROM node:18 AS server
LABEL builder=false
WORKDIR /build
COPY --from=builder /workdir/src/package*.json /build
COPY --from=builder /workdir/src/next.config.js /build
COPY --from=builder /workdir/src/.next /build/.next
COPY --from=builder /workdir/src/public /build/public
COPY --from=builder /workdir/src/node_modules /build/node_modules
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node_modules/.bin/next", "start"]