398f96249c
refs https://github.com/TryGhost/DevOps/issues/118 - we should standardize how we run MySQL, so there aren't massive gaps in developer experience - Docker is great for this, and it's pretty easy to set up - this adds a docker-compose.yml file with a small MySQL setup - also configures `yarn setup` to spin up the Docker container and add it to config.local.json - in the near future, we'll provide a base SQL file in .github/scripts/mysql-preload to ensure the DB is in a known state
20 lines
461 B
YAML
20 lines
461 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:8.0.35
|
|
container_name: ghost-mysql
|
|
ports:
|
|
- "3306:3306"
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: ghost
|
|
restart: always
|
|
volumes:
|
|
# Turns out you can drop .sql or .sql.gz files in here, cool!
|
|
- ./mysql-preload:/docker-entrypoint-initdb.d
|
|
healthcheck:
|
|
test: "mysql -uroot -proot ghost -e 'select 1'"
|
|
interval: 1s
|
|
retries: 120
|