Skip to content

Instantly share code, notes, and snippets.

@kevinadhiguna
Last active September 4, 2021 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinadhiguna/799a727a15e5c09b578608a1357b7cd6 to your computer and use it in GitHub Desktop.
Save kevinadhiguna/799a727a15e5c09b578608a1357b7cd6 to your computer and use it in GitHub Desktop.
Ghost (blogging platform in JavaScript) and MySQL powered by docker-compose
version: '3.1'
services:
# Ghost
ghost:
image: ghost:4-alpine
restart: always
depends_on:
- mysql_db
ports:
- 8080:2368
# Make the change persistent (statfeul)
volumes:
- ghost-volume:/var/lib/ghost
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: mysql_db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost
url: http://localhost:8080
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
#NODE_ENV: development
# MySQL
mysql_db:
image: mysql:5.7
restart: always
# Make the database persistent (statfeul)
volumes:
- mysql-volume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
ghost-volume:
mysql-volume:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment