-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (27 loc) · 1008 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
ARG NODE_VERSION=20
ARG PNPM_VERSION=9.12.2
ARG ALPINE_VERSION=3.20
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS build
WORKDIR /app
ENV DOCKER=true
ENV PNPM_VERSION=${PNPM_VERSION}
RUN wget -qO /bin/pnpm "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" && chmod +x /bin/pnpm
COPY package.json .
COPY pnpm-lock.yaml .
COPY patches/ patches/
RUN pnpm install --frozen-lockfile --strict-peer-dependencies
COPY . .
RUN pnpm run build
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS runtime
WORKDIR /app
ENV DOCKER=true
ENV NODE_ENV=production
ENV PNPM_VERSION=${PNPM_VERSION}
RUN wget -qO /bin/pnpm "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" && chmod +x /bin/pnpm
EXPOSE 3000
COPY --from=build /app/package.json .
COPY --from=build /app/pnpm-lock.yaml .
COPY --from=build /app/patches/ patches/
COPY --from=build /app/build build/
RUN pnpm install --frozen-lockfile --strict-peer-dependencies
CMD ["node","build/index.js"]