1

I have a monolithic application running on Docker, and for the databases, I'm using persistent disk for SQL and NoSQL databases.

The problem is, everytime I deploy a new version, these persistent disk must be commited and push to the repository and the size are really big.

Then there is also a time when the commit between local and origin are different. What is the best way to handle persistent disk? and how can I deploy with zero downtime caused by this persistent disks.

8
  • Can you describe your workflow in more detail? How do you build a new image when there is a new build of your software? How do you mount the persistent disks into the containers? (What is the "commit and push" step exactly?) Commented Dec 11, 2020 at 2:39
  • I'm using docker-compose, declaring the persistent volume in docker-compose.yml. Sorry myb I'm using a different term, should be persistent volume instead of persistent disk. Commit and push as regular git repository, then in production server basically just pull and build the image and run it in the container. Git will always be failed to pull, because there was some changes uncommited in the local caused by persistent volume. Commented Dec 11, 2020 at 3:09
  • You're asking 2 different questions it seems, and they both seem too vague. The best way to handle using volumes? It depends on what you want to do I'm afraid. How can I deploy with zero downtime? Also depends on what you are trying to do. It does sound like you should consider storing your database in cloud storage, and retrieving it. For large file storage, you shouldn't be using git (typically). Commented Dec 11, 2020 at 4:20
  • You should be able to launch new containers, with updated images, against the existing data volumes, without "committing" anything. How are files getting modified in the container on the production system that would need to be reflected in source control? Commented Dec 11, 2020 at 12:03
  • @DavidMaze you mean like put those folders in .gitignore? let me check and will inform you the result, I remember I put those in gitignore, but not sure right now Commented Dec 11, 2020 at 15:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.