笔墨伺候ss
2019-03-14 14:29
找不到/var/lib/ghost/package.json
非常感谢
太感谢了!!
由于老师没有指定ghost的版本,因此默认是拉最新版的ghost。现在ghost版本已经迭代到了2.x系列,因此我们在Dockerfile中的配置也要跟着变。要变的地方有:
1:将本地的config.js文件拷贝到镜像 /var/lib/ghost/content/config.js中
2:由于最新版本的ghost的基础镜像里面已经配置了CMD指令,因此我们不需要在我们本地的Dockerfile中声明CMD指令,直接删掉即可。
这样再重新构建镜像,然后 docker-compose up一下,应该就能跑起来了
你有在ghost 里面写config.js,这个文件夹里面有两个文件 config.js 和 Dockerfile
config.js里面内容是
var path = require('path'),
config;
config = {
production: {
url: 'http://mytestblog.com',
mail: {},
database: {
client: 'mysql',
connection: {
host: 'db',
user: 'ghost',
database: 'ghost',
port: '3306',
charset: 'utf-8'
},
debug: false
},
paths: {
contentPath: path.join(process.env.GHOST_CONTENT,'/')
},
server: {
host: '0.0.0.0',
port: '2368'
}
}
};
module.exports =config;Docker入门
97753 学习 · 255 问题
相似问题