I absolutely don’t get, whats up with the paths when you want to run docker compose and got something like:
What does the first path mean… and what does the second path after “:” mean? The only thing I understand is, that somehow directories (?) get … “connected”? One of your local directories with one of your container… is that right?
But for what is this good for? Only if you want to access files of your container easily?
Am I able to change the paths and what should I be carefull about?
I really tried to understand https://docs.docker.com/compose/compose-file/07-volumes/#example, but either I’m to stupid or the explanation is bad formulated.
I really would be thankful, if someone could explain it to me
Left side: source on host
Right side: target in container
So for example in
I can change the left side how i want, but the right side should stay the same? (because the documentation of gitea tells you to use /data)
Never change the container path to something else than what it says in the image description, unless you know what you are doing, and know how to configure the container to work with the changed container path.
Of course, you can configure the left-hand side to a path of your choice or use a managed volume instead. See: Volumes | Docker Docs
Thank you very much
So for backups, i can simply use the left path and back it up (and restore it to the path). This would be alot easier then doing stuff like mysql dump. It took me ages to figure out, how to use mysql dump if mysql is also a docker container
Just make sure your container is not running when you create a backup of the host path. Otherwise, you might back up an inconsistent state, which btw. does not happen with mysql dump.
Alright, got it. Thank you alot