diff --git a/ghost/README.md b/ghost/README.md index 71d874d..97c8237 100644 --- a/ghost/README.md +++ b/ghost/README.md @@ -7,9 +7,12 @@ ghost ```yaml version: "3.8" + services: + ghost: image: ghost:alpine + container_name: ghost ports: - "2368:2368" volumes: @@ -19,6 +22,21 @@ services: - database__client=sqlite3 - database__connection__filename=/var/lib/ghost/content/data/ghost.db restart: unless-stopped + + backup: + image: offen/docker-volume-backup + container_name: backup + environment: + - BACKUP_FILENAME=backup-ghost-%Y-%m-%dT%H-%M-%S.tar.gz + - BACKUP_PRUNING_PREFIX=backup-ghost- + - 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 ``` ## Up and Running @@ -26,6 +44,7 @@ services: ```bash $ docker-compose up -d $ curl https://blog.easypi.duckdns.org/ghost/ +$ docker-compose exec backup backup ``` ## Setup SSL diff --git a/ghost/docker-compose.yml b/ghost/docker-compose.yml index 8a37851..13783fe 100644 --- a/ghost/docker-compose.yml +++ b/ghost/docker-compose.yml @@ -1,7 +1,10 @@ version: "3.8" + services: + ghost: image: ghost:alpine + container_name: ghost ports: - "2368:2368" volumes: @@ -11,3 +14,18 @@ services: - database__client=sqlite3 - database__connection__filename=/var/lib/ghost/content/data/ghost.db restart: unless-stopped + + backup: + image: offen/docker-volume-backup + container_name: backup + environment: + - BACKUP_FILENAME=backup-ghost-%Y-%m-%dT%H-%M-%S.tar.gz + - BACKUP_PRUNING_PREFIX=backup-ghost- + - 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