Run Ghost in Docker compose
Experimenting with running Ghost in Docker compose
Experimenting with running Ghost in Docker compose. This is what I've started with:
services:
ghost:
image: ghost:5-alpine
restart: unless-stopped
ports:
- "3055:2368"
depends_on: # Ensure MySQL is ready before Ghost starts
- db
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: db
database__connection__user: ghost
database__connection__password: ${GHOST_DB_PASSWORD}
database__connection__database: ghost
url: https://da.nmilne.com
volumes:
- ghost:/var/lib/ghost/content
db:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ghost
MYSQL_USER: ghost
MYSQL_PASSWORD: ${GHOST_DB_PASSWORD}
volumes:
- db:/var/lib/mysql
volumes:
ghost:
db:
Pretty straightforward.