2022-07-18 20:50:38 +08:00
|
|
|
FROM node:16-alpine as base
|
2022-07-18 22:34:27 +08:00
|
|
|
RUN apk add --no-cache libc6-compat
|
2022-07-18 20:50:38 +08:00
|
|
|
WORKDIR /app
|
2022-10-09 00:23:16 +08:00
|
|
|
COPY pnpm-lock.yaml package.json ./
|
2022-10-09 00:29:37 +08:00
|
|
|
RUN npm i --location=global pnpm@7 &&\
|
2022-10-09 00:47:29 +08:00
|
|
|
pnpm i
|
2022-07-18 20:50:38 +08:00
|
|
|
|
|
|
|
FROM node:16-alpine as release
|
|
|
|
WORKDIR /app
|
2022-10-09 00:47:29 +08:00
|
|
|
COPY . .
|
2022-07-18 20:50:38 +08:00
|
|
|
COPY --from=base /app ./
|
2022-10-08 22:45:31 +08:00
|
|
|
RUN pnpm build &&\
|
|
|
|
pnpm prune --prod
|
2022-07-18 20:50:38 +08:00
|
|
|
EXPOSE 80
|
2022-10-08 22:45:31 +08:00
|
|
|
CMD pnpm serve -p 80
|