-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathDockerfile
39 lines (27 loc) · 766 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:20-alpine3.20 AS builder
ARG PLAUSIBLE_SITE
ARG PLAUSIBLE_HOST
ENV NEXT_PUBLIC_PLAUSIBLE_SITE=${PLAUSIBLE_SITE}
ENV PLAUSIBLE_HOST=${PLAUSIBLE_HOST}
WORKDIR /build
COPY .yarn/releases ./.yarn/releases
COPY package.json ./
COPY yarn.lock ./
COPY .yarnrc.yml ./
RUN yarn install --immutable
COPY . .
RUN yarn build
FROM node:20-alpine3.20 AS runner
RUN apk add dumb-init
USER node
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /build/next.config.js ./
COPY --from=builder /build/public ./public
COPY --from=builder /build/package.json ./package.json
COPY --from=builder /build/.next/standalone ./
COPY --from=builder /build/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
ENTRYPOINT ["dumb-init", "--"]
CMD ["node", "server.js"]