Having trouble mounting host folders during `docker build` on Dokploy server
I have a SvelteKit project that uses a sqlite3 DB as its backing database. Since building the project currently requires the DB file to be present, I've tried copying the DB file to the Dokploy server and binding the mount in the Dockerfile when building:
However, when building the image, the deployment log errors out:
...even though the file is available on disk:
I realise this is separate from the Volumes configuration under Advanced for the running container itself, which I've already configured to the same path.
I'm wondering whether that's because the path might not be accessible by the
docker build
user? Or is there an idiomatic way of providing resources to the docker build
process when building?1 Reply
ok, i've solved the build-time db file dependency by skipping the connection while building the project. might not be ideal, but at least the image builds and gets deployed.
i do have the same problem where the even after configuring the bind mount on the deployed image, the build image cannot access the mounted file:
oh... 🤦♂️ i didn't realise it should be using
./db/main.db
since i'm mounting it locally in /app/db
, it does work now
ok, guess that's that problem solved.
i still have a question re: build-time resources - is there a way to provide the DB file during build?