Mounting a single file is technically not possible. This is troublesome if you want to write to a file in the /app folder. But there is a trick that you can use to emulate the behavior.
On your local development go to the source code of your project.
- Create a folder
- Create an empty file in that directory
- Add the mount folder to git:
git add file_mounts
- Edit the
.platform.app.yamlfile and add a mount point.
mounts: 'file_mounts': source: local source_path: 'file_mounts'
git committhe changes and push them to your environment
- You can now write to the
example.txtfile in the deploy hook, or during production.