-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (25 loc) · 838 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
FROM node:16-alpine as base
FROM base as builder
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build
RUN rm -rf .next/standalone/.yarn
FROM base AS runner
WORKDIR /app
COPY --from=builder /app/.next/standalone .
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
COPY --from=builder /app/.yarn/releases ./.yarn/releases
COPY --from=builder /app/.yarn/cache ./.yarn/cache
COPY --from=builder /app/.yarn/unplugged ./.yarn/unplugged
COPY --from=builder /app/.pnp.cjs ./.pnp.cjs
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/yarn.lock ./yarn.lock
COPY --from=builder /app/.yarnrc.yml ./yarnrc.yml
COPY --from=builder /app/.env ./.env
ENV NODE_ENV production
ENV PORT 3000
ENV HOSTNAME 0.0.0.0
EXPOSE 3000
CMD ["node" , "-r", "./.pnp.cjs", "server.js"]