How to handle database working with Docker?

Asked

Viewed 972 times

0

I started working with docker recently and there is a doubt and in a preparation for an environment wordpress lamp , I stumbled upon climbing my bank and my files .

The idea was to leave everything inside a repository inside the git-hub that I could clone from anywhere create the image and restore my site, however the repository of git-hub has a limit of 100 megas.

How I can work effectively with the bank in these cases using Docker?

You have to be part of an image to upgrade to the server or treat the sql the part?

  • Your doubt would be the ideal way to see your Docker image?

  • When working with Docker to have a container of a wordpress, the correct way to work with the database would be he be part of the image ? pq I am studying these codes of a Docker -Compose and in case it creates the image. My question is whether I work so always on top of this script that prepares everything and creates the image and climbs the bank or as you said keep it straight in the image. , for example, I thought about keeping everything on github but it doesn’t support the bank file because it’s too big.

  • 1

    So I will comment here because it is my opinion. I would do in Dockerfile the creation of the bank, but would be in a container different from the application. There is a standard called data-only container that recommends this separation: http://container42.com/2013/12/16/persistent-volumes-with-docker-container-volumeopattern/.

1 answer

3


It makes no sense to have the BD image, what you will have will be the BD service, not the bank itself!

You should have the database on a file system Ocker, and you should do regular backups from the database tool itself.

In case of disaster the bank will be recovered through backup, not an image.

Databases perform transactions, calculations, etc... The database tool has the intelligence not to let the transaction stop in the middle of the way. And it also has the fact that it is possible depending on the bank to make online backups of transactions, ie every 15 minutes you can have a backup, in case of disaster the possibility is that if you lose only 15 minutes of transaction, this type of Feature you do not have in an image.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.