Ghost (Blog) Container

Ghost (Blog) Container
Photo by Rubaitul Azad / Unsplash

Getting this website off the ground has actually been somewhat of a thorn in my side, which is ironic as it's a fairly simple deployment to do in terms of containers.

I am assuming it's still part of the learning process, but I often find that it resets back to day 1 and loses all the stored data, its configuration and previously made posts.

I'm not sure if I've missed something or if it's a fault with my larger setup, but it continues to elude me.

version: "3.8"

services:
ghost:
image: ghost:latest
container_name: ghost
restart: unless-stopped
ports:
- "2368:2368"
environment:
- url= # Change to your domain or server IP
- database__client=********
- database__connection__host=********
- database__connection__user=********
- database__connection__password=********
- database__connection__database=********
volumes:
- ghost-data:/var/lib/ghost/content
depends_on:
- db

db:
image: mysql:latest
container_name: ghost-db
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=********
- MYSQL_DATABASE=********
- MYSQL_USER=********
- MYSQL_PASSWORD=********
volumes:
- ghost-db:/var/lib/mysql

volumes:
ghost-data:
ghost-db: