1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-14 11:23:02 +02:00
dockerfiles/ghost/README.md

99 lines
2.2 KiB
Markdown
Raw Normal View History

2015-08-31 01:53:16 +02:00
ghost
=====
2016-05-05 14:11:54 +02:00
[Ghost][1] is a free and open source blogging platform written in JavaScript.
2015-08-31 01:53:16 +02:00
## docker-compose.yml
2016-05-05 14:11:54 +02:00
```yaml
2022-01-14 05:41:17 +02:00
version: "3.8"
2022-01-21 05:50:30 +02:00
2022-01-14 05:41:17 +02:00
services:
2022-01-21 05:50:30 +02:00
2022-01-14 05:41:17 +02:00
ghost:
image: ghost:alpine
ports:
- "2368:2368"
volumes:
- ./data:/var/lib/ghost/content
environment:
- url=https://blog.easypi.duckdns.org
- database__client=sqlite3
- database__connection__filename=/var/lib/ghost/content/data/ghost.db
restart: unless-stopped
2022-01-21 05:50:30 +02:00
backup:
image: offen/docker-volume-backup
environment:
2022-02-11 09:57:55 +02:00
# AWS_BUCKET_NAME=backups
# AWS_S3_PATH=ghost
# AWS_ACCESS_KEY_ID=******
# AWS_SECRET_ACCESS_KEY=******
2022-01-21 05:50:30 +02:00
- BACKUP_FILENAME=backup-ghost-%Y-%m-%dT%H-%M-%S.tar.gz
- BACKUP_PRUNING_PREFIX=backup-ghost-
2022-02-11 09:57:55 +02:00
- BACKUP_LATEST_SYMLINK=backup-ghost-latest.tar.gz
2022-01-21 05:50:30 +02:00
- BACKUP_RETENTION_DAYS=30
volumes:
- ./data:/backup/ghost:ro
- ./backups:/archive
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- ghost
restart: unless-stopped
2015-08-31 01:53:16 +02:00
```
## Up and Running
2016-05-05 14:11:54 +02:00
```bash
2017-08-30 14:26:38 +02:00
$ docker-compose up -d
2021-02-02 12:52:08 +02:00
$ curl https://blog.easypi.duckdns.org/ghost/
2022-01-21 05:50:30 +02:00
$ docker-compose exec backup backup
2015-08-31 01:53:16 +02:00
```
2016-05-05 14:11:54 +02:00
## Setup SSL
> Read [this][2] to setup SSL.
2021-02-02 12:52:08 +02:00
```nginx
2016-05-05 14:11:54 +02:00
server {
listen 80 default;
server_name _;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
2021-02-02 12:52:08 +02:00
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;
2016-05-05 14:11:54 +02:00
location / {
2021-02-02 12:52:08 +02:00
if ($host = 'easypi.duckdns.org') {
2016-05-05 14:11:54 +02: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 05:41:17 +02: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 14:11:54 +02:00
[1]: https://ghost.org/
[2]: http://support.ghost.org/setup-ssl-self-hosted-ghost/
2021-02-02 12:52:08 +02:00
[3]: https://blog.easypi.duckdns.org/ghost/settings/code-injection/