mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
c4baf28823
no issue - The current devcontainer setup was built with the intention of using it as the _primary_ way of running Ghost in Docker locally. As such, it was designed to be extensible — there was a `base.compose.yml` file with the default configuration, and multiple other `compose.yml` files that could be added to extend the base setup to cover different use-cases. - We've run into some problems with using the devcontainer for regular day to day usage, so we're moving toward using a more conventional `compose` based setup for more advanced configurations. - We're going to keep the devcontainer around as it's still nice for a quick and easy setup, but it no longer needs to support multiple configurations — as such, we can simplify the setup to a single `compose.yml` file to make it easier to reason about and troubleshoot if anything goes wrong. - This commit removes the `.devcontainer/.docker` directory, and many of the files that were in it. The main `compose.yml` file and the Dockerfile were moved to the root of `.devcontainer` which should make the setup a bit easier to follow and modify as needed.
50 lines
No EOL
1.4 KiB
YAML
50 lines
No EOL
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: .devcontainer/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: |