# Setting up a sample SQLite db for testing

**URL:** <https://forum.ghost.org/t/setting-up-a-sample-sqlite-db-for-testing/49122>\
**Category:** Developer help\
**Created:** [July 28, 2024, 3:48pm UTC](https://forum.ghost.org/t/setting-up-a-sample-sqlite-db-for-testing/49122 "2024-07-28T15:48:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kincsescsaba](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kincsescsaba/32/12243_2.png) [@kincsescsaba](https://forum.ghost.org/u/kincsescsaba)\
**Post date:** [July 28, 2024, 3:48pm UTC](https://forum.ghost.org/t/setting-up-a-sample-sqlite-db-for-testing/49122/1 "2024-07-28T15:48:48Z")

</div>

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:

```auto
sqlite3 file.db "VACUUM;"

```

The image was started this way:

```auto
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:

```auto
[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

```
