Skip to content

Commit d8137f1

Browse files
authored
Added yarn dev:sqlite command for SQLite development (#27088)
no refs ## Summary - Added `compose.dev.sqlite.yaml` Docker Compose override that disables the MySQL container and configures Ghost to use SQLite - Added `yarn dev:sqlite` script to `package.json` for running the dev environment with SQLite instead of MySQL - Mounts the SQLite database directory to the host for easy access - Mostly this is useful when testing migrations on sqlite
1 parent 16745a9 commit d8137f1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

compose.dev.sqlite.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
mysql:
3+
# Prevents mysql container from starting up
4+
profiles:
5+
- mysql
6+
7+
ghost-dev:
8+
volumes:
9+
# Override the named volume so the SQLite DB is accessible on the host.
10+
- ./ghost/core/content/data:/home/ghost/ghost/core/content/data
11+
environment:
12+
database__client: sqlite3
13+
database__connection__filename: content/data/ghost-dev.db
14+
depends_on:
15+
mysql:
16+
required: false

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"build:clean": "nx reset && rimraf -g 'ghost/*/build' && rimraf -g 'ghost/*/tsconfig.tsbuildinfo'",
2828
"clean:hard": "node ./.github/scripts/clean.js",
2929
"dev": "nx run ghost-monorepo:docker:dev",
30+
"dev:sqlite": "DEV_COMPOSE_FILES='-f compose.dev.sqlite.yaml' nx run ghost-monorepo:docker:dev",
3031
"dev:mailgun": "DEV_COMPOSE_FILES='-f compose.dev.mailgun.yaml' nx run ghost-monorepo:docker:dev",
3132
"dev:lexical": "EDITOR_URL=http://localhost:2368/ghost/assets/koenig-lexical/ yarn dev",
3233
"dev:analytics": "DEV_COMPOSE_FILES='-f compose.dev.analytics.yaml' nx run ghost-monorepo:docker:dev",

0 commit comments

Comments
 (0)