R
Railway10mo ago
gregar

Docker Image Doesn't Build with all the steps

Hey all, I have a node/express in Github that builds and runs as a docker container (there's a dockerfile present). I'm running a service using nixpack to build and run this service but it always seems to skip a step which is to create a localized db using a .sql file. This is then accessed by express using sqlite3. Thes container builds and runs perfectly on my local machine but the platform seems to have this issue. Any advice?
9 Replies
Percy
Percy10mo ago
Project ID: 9739d79b-82e5-413b-b67b-6489da31819c
Brody
Brody10mo ago
Dockerfiles and Nixpacks are mutually exclusive
gregar
gregarOP10mo ago
9739d79b-82e5-413b-b67b-6489da31819c
Brody
Brody10mo ago
usually creating the sqlite file is done in code automatically by the driver when a preexisting sqlite file isnt found at the given path
gregar
gregarOP10mo ago
Hmm.. I have a line in the dockerfile that has npm run a node script to manually create the db file and it's been working locally. On the platform it seems not to build it properly as the console logs error that a specific table doesn't exist - this table is created by said script.
Brody
Brody10mo ago
are you using a volume?
gregar
gregarOP10mo ago
no. It's just a dockerfile that runs a node/express webserver
Brody
Brody10mo ago
run the script during runtime, you also need to use a volume and have the sqlite file saved into the volume, otherwise your sqlite file is going to be removed on every deploy
gregar
gregarOP10mo ago
Will try running the script at runtime. The app is only for prototyping/template purposes so don't mind if the db is constantly up/down
Want results from more Discord servers?
Add your server