Open cosminonea opened 1 day ago
@cosminonea You can use "files" config, something like:
accessories:
db:
files:
- path-to-file-in-your-repo:/.gcloud/sql-proxy-key.json:ro
See https://kamal-deploy.org/docs/configuration/accessories/#copying-files
BTW, the better place for asking such questions is https://github.com/basecamp/kamal/discussions
Thanks @morgoth
I read the documentation but these are secret files though, they won't be in the repo. But I guess I can put them in the repo as a pre-deployment step in a Github Action, is this how one would do it?
By default kamal builds image from the git commited files only, so you would need to change the build context to make it work this way. https://kamal-deploy.org/docs/configuration/builder-examples/#using-a-different-dockerfile-or-context-when-building
That is for building the image, which happens on the build machine not the host (where the docker containers will be running) as I understand it. And also, you wouldn't want the secret files to be bundled into the image.
I am using Kamal 2 to deploy a background job. The job needs to connect to a Google Cloud SQL instance. I am running the cloud proxy as an accessory service like below:
This fails because the
/.gcloud/sql-proxy-key.json
doesn't exist in the container.How would I copy that file (and other secret files) from my machine onto the host during
setup
ordeploy
? Does kamal do that or do I have to push the files onto the host outside kamal?