a year ago
https://github.com/howesc/sveltekit-sqlite
Hello! Please help me, attempting the following:
Deploy Sveltekit app via Dockerfile
Store SQLIte DB on persistent volume
Apply DB migrations during deployment
I've got close but no cigar. According to the build logs the /migrate script runs fine - the script creates a users table. However according to the app logs, the app cannot see the users table. I think the migration script and app might be looking at two different locations, although within the app they both reference the same path "./vol/db.sqlite".
From build log: #13 0.138 database path: vol/db.sqlite
From app log: SqliteError: no such table: user
3 Replies
a year ago
You're running your migrations during build.
The volume is not mounted during build.
Run your migrations during runtime before starting your app.
a year ago
Awesome, you're a legend!
I did this:
Remove from Dockerfile:
# RUN mkdir vol
# RUN node migrateModify package.json:
"start": "node migrate && node build"a year ago
Perfect, thank you for following backup with the exact solution that worked for you!
Status changed to Solved brody • about 1 year ago

