Ghost/.devcontainer/compose.yml
Chris Raible 05127ddc5c
Reorganized docker related files (#21650)
ref https://linear.app/ghost/issue/ENG-1782/move-docker-related-files-to-a-better-location-that-githubscripts

- The docker files are currently located in `.github/scripts`. This location doesn't make a lot of sense — you wouldn't think to look there unless you already knew they were there. This also requires you to specify the path to the `compose.yml` file whenever running a `docker compose ...` command. 
- This commit moves the `compose.yml` file to the root of the repo, so you can simply run `docker compose up` and it will automatically find the file in the root, without having to specify `-f .github/scripts/docker-compose.yml`. This is a major win for convenience over the current setup.
- It also moves all the related files, including the `Dockerfile` used by the Dev Container setup and configuration files for supporting services into a new `.docker` directory, which is a more logical location, and should be easier to find.
- Also updated the current convenience commands in the `package.json` scripts block (`yarn docker:reset` and `yarn docker:down`
2024-11-19 13:15:06 -08:00

50 lines
1.4 KiB
YAML

# Base container and services for running Ghost
## Intended to be extended by another compose file
## e.g. docker compose -f base.compose.yml -f development.compose.yml up
## Does not include development dependencies, Ghost code, or any other dependencies
name: ghost-devcontainer
services:
ghost:
image: ghost-devcontainer
command: ["sleep", "infinity"]
build:
context: ../
dockerfile: .docker/Dockerfile
target: base-devcontainer
pull_policy: never
environment:
- DEVCONTAINER=true
tty: true
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
mysql:
image: mysql:8.0.35
# We'll need to look into how we can further fine tune the memory usage/performance here
command: --innodb-buffer-pool-size=1G --innodb-log-buffer-size=500M --innodb-change-buffer-max-size=50 --innodb-flush-log-at-trx_commit=0 --innodb-flush-method=O_DIRECT
ports:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ghost
restart: always
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: "mysql -uroot -proot ghost -e 'select 1'"
interval: 1s
retries: 120
redis:
image: redis:7.0
ports:
- "6379"
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1s
retries: 120
volumes:
mysql-data: