2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2026-01-04 12:05:02 +01:00

update ghost

This commit is contained in:
kev
2021-02-02 18:52:08 +08:00
parent 5771e5c1c7
commit d07fcd4bbd
6 changed files with 23 additions and 104 deletions

View File

@@ -12,25 +12,25 @@ ghost:
- "127.0.0.1:2368:2368"
volumes:
- ./data:/var/lib/ghost/content
- ./data/config.json:/var/lib/ghost/config.production.json
restart: always
environment:
- url=https://blog.easypi.duckdns.org
- database__client=sqlite3
- database__connection__filename=/var/lib/ghost/content/data/ghost.db
restart: unless-stopped
```
## Up and Running
```bash
$ mkdir data
$ cd data
$ wget https://github.com/vimagick/dockerfiles/raw/master/ghost/data/config.json
$ sed -i 's@http://localhost:2368@https://blog.easypi.pro@' config.js
$ docker-compose up -d
$ curl https://blog.easypi.duckdns.org/ghost/
```
## Setup SSL
> Read [this][2] to setup SSL.
```
```nginx
server {
listen 80 default;
server_name _;
@@ -41,11 +41,11 @@ server {
server {
listen 443 ssl;
server_name easypi.pro blog.easypi.pro;
ssl_certificate ssl/easypi.pro.crt;
ssl_certificate_key ssl/easypi.pro.key;
server_name easypi.duckdns.org blog.easypi.duckdns.org;
ssl_certificate ssl/easypi.duckdns.org/fullchain.pem;
ssl_certificate_key ssl/easypi.duckdns.org/privkey.pem;
location / {
if ($host = 'easypi.pro') {
if ($host = 'easypi.duckdns.org') {
return 301 $scheme://blog.$host$request_uri;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -71,4 +71,4 @@ files without editing them.
[1]: https://ghost.org/
[2]: http://support.ghost.org/setup-ssl-self-hosted-ghost/
[3]: https://blog.easypi.pro/ghost/settings/code-injection/
[3]: https://blog.easypi.duckdns.org/ghost/settings/code-injection/