smallpath / blog

前后端分离+服务端渲染的博客系统. 基于Vue2、Koa2、MongoDB、Redis

Home Page:https://smallpath.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerfile 无法正常使用

qfdk opened this issue · comments

commented

使用 docker build -t blog . 进行docker 打包测试未能成功.

错误提示如下

npm ERR! Linux 4.9.13-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "yarn" "pm2"
npm ERR! node v7.7.4
npm ERR! npm  v4.1.2
npm ERR! path /usr/local/bin/yarn
npm ERR! code EEXIST

npm ERR! Refusing to delete /usr/local/bin/yarn: node_modules/npm/bin/npm-cli.js symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/bin/yarn
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log
The command '/bin/sh -c npm install -g yarn pm2' returned a non-zero code: 1

似乎现在改成了用 yarn 管理的方式

建议 docker 打成直接可运行的包(加上 mongo 和 redis)

还有个问题为什么要用 redis ?

  • yarn可以解决国内国外的网络问题
  • 直接加mongo redis太大了
    • 因为配置文件支持传环境变量,分出去的话可以直接指定host
  • redis目前只用来存了token,但是之后会做一层SortedSet缓存