1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-28 17:51:24 +00:00
dockerfiles/ghost/README.md

75 lines
1.5 KiB
Markdown
Raw Normal View History

2015-08-30 23:53:16 +00:00
ghost
=====
2016-05-05 12:11:54 +00:00
[Ghost][1] is a free and open source blogging platform written in JavaScript.
2015-08-30 23:53:16 +00:00
## docker-compose.yml
2016-05-05 12:11:54 +00:00
```yaml
2015-08-30 23:53:16 +00:00
ghost:
2017-04-30 15:36:09 +00:00
image: ghost:alpine
2016-05-05 12:11:54 +00:00
ports:
- "127.0.0.1:2368:2368"
2017-04-30 15:36:09 +00:00
volumes:
2017-08-06 02:34:48 +00:00
- ./data:/var/lib/ghost/content
2017-08-30 12:26:38 +00:00
- ./data/config.json:/var/lib/ghost/config.production.json
2016-05-05 12:11:54 +00:00
restart: always
2015-08-30 23:53:16 +00:00
```
## Up and Running
2016-05-05 12:11:54 +00:00
```bash
2017-08-30 12:26:38 +00:00
$ mkdir data
2017-04-30 15:36:09 +00:00
$ cd data
2017-08-30 12:26:38 +00:00
$ 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
2015-08-30 23:53:16 +00:00
```
2016-05-05 12:11:54 +00:00
## Setup SSL
> Read [this][2] to setup SSL.
```
server {
listen 80 default;
server_name _;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
2017-08-30 12:26:38 +00:00
server_name easypi.pro blog.easypi.pro;
ssl_certificate ssl/easypi.pro.crt;
ssl_certificate_key ssl/easypi.pro.key;
2016-05-05 12:11:54 +00:00
location / {
2017-08-30 12:26:38 +00:00
if ($host = 'easypi.pro') {
2016-05-05 12:11:54 +00:00
return 301 $scheme://blog.$host$request_uri;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:2368;
}
}
```
2016-05-06 03:41:17 +00:00
## Ghost Setup
[Ghost][3] allows you to inject code into the top and bottom of your theme
files without editing them.
```css
<style>
pre code, pre tt {
white-space: pre !important;
}
</style>
```
2016-05-05 12:11:54 +00:00
[1]: https://ghost.org/
[2]: http://support.ghost.org/setup-ssl-self-hosted-ghost/
2017-08-30 12:26:38 +00:00
[3]: https://blog.easypi.pro/ghost/settings/code-injection/