Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use database volumes in docker-compose by default #2676

Closed
GaryPWhite opened this issue Feb 6, 2024 · 3 comments · Fixed by #2677
Closed

Use database volumes in docker-compose by default #2676

GaryPWhite opened this issue Feb 6, 2024 · 3 comments · Fixed by #2677

Comments

@GaryPWhite
Copy link
Contributor

GaryPWhite commented Feb 6, 2024

Is your feature request related to a problem? If so, please describe the problem:
When installing / using augur with docker -- the postgres database is tied directly to the data within the encircling container. As containers / drives sometimes fail -- this is a brittle way to set up the database that may hold 100's of thousands of repositories worth of valuable metadata.

Potential solutions:
mount a volume into the postgres docker image that could be mounted from a volume, eventually put in a redundant filesystem / nfs mount or standard backup mount on a cloud instance.

From their documentation the mount would be associated with a respective PGDATA environment variable to avoid unexpected behavior.

$ docker run -d \
	--name some-postgres \
	-e POSTGRES_PASSWORD=mysecretpassword \
	-e PGDATA=/var/lib/postgresql/data/pgdata \
	-v /custom/mount:/var/lib/postgresql/data \
	postgres

This allows a decoupled volume to exist regardless of containers being started/restarted/removed/recreated.

Additional context:
postgres docker image

I'm happy to work on this, just wanted to see the interest or if there's a good reason not to include the data in a volume!

@GaryPWhite GaryPWhite changed the title Use database volumes by default Use database volumes in docker-compose by default Feb 6, 2024
@sgoggins
Copy link
Member

sgoggins commented Feb 6, 2024

@GaryPWhite : That's a really good idea! We would quickly merge a PR if you have time to do that!

@GaryPWhite
Copy link
Contributor Author

will do!

@sgoggins
Copy link
Member

Fixed by PR #2677

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants