Ghost在docker上的配置
参考
- Ghost:https://headlesscms.org/projects/ghost
- Ghost docker:
- [https://hub.docker.com//ghost](https://hub.docker.com//ghost)
- https://hub.docker.com/r/bitnami/ghost/
- Using Docker Compose & Mysql to set up a ghost blog:https://aboullaite.me/docker-compose-ghost/
首先确保 network_mynginx 网络提前创建好
docker network create -d bridge mynginx_network
运行
docker run -d --rm --name my-ghost \
--network mynginx_network \
-e url=http://localhost:3002 \
-p 3002:2368 ghost
nginx代理
# jekyll_web
upstream jekyll_web {
# jekyll
server my-jekyll-web:4000;
}
upstream ghost_web {
# jekyll
server myghost:2368;
}
server {
listen 80;
server_name localhost;
location / {
# proxy_pass http://jekyll_web/;
proxy_pass http://ghost_web/;
}
}
启动nginx
docker run --rm -d -p 80:80 \
--name mynginx --network host --network network_mynginx\
-v $PWD/www:/usr/share/nginx \
-v $PWD/conf.d:/etc/nginx/conf.d \
-v $PWD/nginx.conf:/etc/nginx/nginx.conf \
-v $PWD/log:/var/log/nginx \
nginx