Dockerfile 420 B

123456789101112131415161718192021222324
  1. FROM node:lts-alpine as builder
  2. #环境变量写在build后面否则找不到指令
  3. ENV PROJECT_ENV production
  4. ENV NODE_ENV production
  5. ENV NODE_OPTIONS=--openssl-legacy-provider
  6. RUN export NODE_OPTIONS
  7. # 设置时区
  8. #RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  9. #RUN echo 'Asia/Shanghai' >/etc/timezone
  10. WORKDIR /code
  11. ADD package.json /code
  12. RUN npm install
  13. ADD . /code
  14. EXPOSE 7002
  15. CMD npm start