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
Project ID:
9739d79b-82e5-413b-b67b-6489da31819c
Dockerfiles and Nixpacks are mutually exclusive
9739d79b-82e5-413b-b67b-6489da31819c
usually creating the sqlite file is done in code automatically by the driver when a preexisting sqlite file isnt found at the given path
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.
are you using a volume?
no. It's just a dockerfile that runs a node/express webserver
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
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