Dockerfile 619 B

123456789101112131415161718192021222324
  1. # 设置基础镜像,如果本地没有该镜像,会从Docker.io服务器pull镜像
  2. FROM qtrj.i234.me:8084/node:10.19.0
  3. MAINTAINER felixyin<ybkk1027@gmail.com>
  4. # 安装npm模块
  5. RUN npm install pm2 bower -g --registry=https://registry.npm.taobao.org;
  6. VOLUME /code
  7. WORKDIR /code
  8. ADD . .
  9. # 安装web静态资源
  10. RUN bower install --allow-root;
  11. # 安装node依赖库
  12. RUN npm install --registry=https://registry.npm.taobao.org;
  13. # 暴露container的端口
  14. EXPOSE 10001
  15. # pm2 启动应用,前台运行,设置日志格式
  16. CMD pm2 start index -i 2 --no-daemon --merge-logs --log-date-format="YYYY-MM-DD HH:mm Z"