Fast updating an yaml file inside the container

I have an application where I have a YAML file that I need to constantly update. By default, it is not inside the container. It is located in the root of my code. And my .env is configured to read the file either in the root of the container or through an external link. I am thinking about the best way to keep updating this file while it is inside the container. For example, I can put a copy command in the Dockerfile. But I would like to keep updating it without needing to do a new deploy. What would be the best way to do this?

I build this application through the Dockerfile. The build process is somewhat time-consuming, and I don’t want to keep deploying it. What I am asking is if there is a strategy where I can just restart the machine and then apply the update to this YAML file without needing to do a complete build.

You could write a code to hit the machine API and update the file: Machines · Fly Docs

1 Like

Just saw in the Docs one can send a file through the toml instead of dockerfile copy.

[[files]]
guest_path = “/path/to/config.yaml”
local_path = “/local/path/config.yaml”

I’ll try it here, if it works I could then ssh console, keep editing the yaml and restart machine.

I’m trying to use the --file-local through console and/or machine update to simple copy to /app/ but getting error:

fly console --file-local "/app/config.yaml=config.yaml"
Error: failed parsing files: failed to read file-local: guest path, /app/config.yaml, must be absolute

For reference I used this: VM for one-off scripts on Rails app - #5 by leo-frdm

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.