Thankfully, after a little bit of research and a lot of insight from this answer on StackOverflow, I learned that it's possible to execute an arbitrary command in an existing Docker container, and then copy files out of it. I had to think of another solution, but without a Docker volume giving access to the files and folders inside, it was unclear if there was anything that could be done. That worked, but it was untenable and prone to failure at best it would be only a matter of time until the database becomes too large and the queries become too slow. As these things go, it was only after the database had been deployed for a few weeks, filled up with real user data, did I realize that I'd forgotten to add a physical Docker volume, leaving me with no way to access the access and back up the data folders inside the container.Īs an emergency fix, I cooked up a quick script to query the database once every day, dump all of its data to a file, and then encrypt/upload that backup somewhere offsite. Many moons ago, I deployed a new database instance inside a Docker container alongside a production application.
0 Comments
Leave a Reply. |