Volume mount(s) for Docker container

Could you please detail what directory/directories I need to mount for dynamic configuration/log directories? I would like to use volume mounts in order to persist the data on a specific storage driver (as well as persist the data when the container is rebuilt with Docker compose).

I created a compose file to help make better sense of the containers.

Thanks, but that does not appear to contain any volumes for configuration. If I were to run docker compose down && docker compose up then all state would be lost.
Edit: having had a poke of the docker container, it might be sufficient to mount /var/lib/postgresql in order to maintain state. Does that sound about right?

I haven’t had time to confirm all of the potential persistent data locations.

Unfortunately it looks like the initial database files are part of the docker image, which means it’s not possible to mount it externally (unless you extract the initial files to your local volume first). Please consider looking at initializing the database within the container so that it is possible to persist the files to a Docker volume (e.g. on a dedicated storage array). It is difficult to manage Docker containers that do not provide volume mount locations for data that needs to be persisted. Thank you!

1 Like