tailwind-nextjs-blog/Dockerfile

16 lines
364 B
Docker
Raw Normal View History

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
COPY package-lock.json package.json ./
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7 &&\
pnpm i &&\
pnpm build
2022-07-18 20:50:38 +08:00
COPY . .
FROM node:16-alpine as release
WORKDIR /app
COPY --from=base /app ./
RUN pnpm build &&\
pnpm prune --prod
2022-07-18 20:50:38 +08:00
EXPOSE 80
CMD pnpm serve -p 80