21 lines
466 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM node:lts-alpine
RUN apk add --no-cache tini
ENV NODE_ENV=production
RUN npm install -g pnpm@9
USER node
WORKDIR /app
COPY --chown=node:node . ./
# --prod 模式下 husky 不会被安装prepare 脚本会因找不到 husky 而失败,
# 故显式跳过生命周期脚本;本项目生产运行也不依赖任何 postinstall 步骤。
RUN pnpm install --frozen-lockfile --prod --ignore-scripts
EXPOSE 3000
CMD [ "/sbin/tini", "--", "node", "app.js" ]