Setting up a sample SQLite db for testing

UPDATE:
I solved the issue; a Docker volume setup was missing to locate the file properly.
The below technique otherwise works; an empty db is populated by Ghost.


Hey there,

I tried using the latest Ghost Alpine Docker image in development, and I provided an empty SQLite database for the image, but it did not work.

I think a minimal database structure is required, though the error message does not go into detail.

Do you have any ideas on how to go with a minimum viable test SQLite database?

SQLite db was created this way:

sqlite3 file.db "VACUUM;"

The image was started this way:

docker run -d --name test-ghost -e NODE_ENV=development -e database__connection__filename='/tmp/testGhostBuildContext/file.db' -p 3001:2368 test-ghost

The error I get looks like this:

[2024-07-28 15:36:42] ERROR SQLITE_CANTOPEN: unable to open database file

SQLITE_CANTOPEN: unable to open database file

"Unknown database error"

Error ID:
    500

Error Code: 
    SQLITE_CANTOPEN

----------------------------------------

Error: SQLITE_CANTOPEN: unable to open database file
    at /var/lib/ghost/versions/5.88.1/node_modules/knex-migrator/lib/database.js:57:19