-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include docker-compose steps in hosting for localized database backups #7929
base: master
Are you sure you want to change the base?
Include docker-compose steps in hosting for localized database backups #7929
Conversation
Aaron Kanzer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR. I agree that it would be useful to include the backup commands in the docker-compose.yaml. I wonder if we should add a backup.sh
to also zip up the fossildb backup with a timestamped filename?
I don't think the explicit networks are required and would prefer to keep them out.
In order to merge PRs from contributors, we need the CLA check to pass. For that all commits need to be authored with matching email info. Sorry for the inconvenience.
@@ -59,6 +61,7 @@ services: | |||
# FossilDB | |||
fossildb: | |||
image: scalableminds/fossildb:master__489 | |||
container_name: webknossos-fossildb-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
container_name: webknossos-fossildb-1 |
# FossilDB Backup -- backup located to ../persistent/fossildb/backup/private after completion | ||
# Example command: docker-compose run --rm fossil-db-backup | ||
fossil-db-backup: | ||
image: scalableminds/fossildb-client:master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: scalableminds/fossildb-client:master | |
image: scalableminds/fossildb-client:master__489 |
depends_on: | ||
fossildb: | ||
condition: service_healthy | ||
command: ["webknossos-fossildb-1", "backup"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command: ["webknossos-fossildb-1", "backup"] | |
command: ["fossildb", "backup"] |
networks: | ||
- webknossos_default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think an explicit network is required. We don't have that in our docker compose-based deployments.
networks: | |
- webknossos_default |
networks: | ||
- webknossos_default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
networks: | |
- webknossos_default |
# Example command: docker-compose run --rm fossil-db-restore | ||
fossil-db-restore: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Example command: docker-compose run --rm fossil-db-restore | |
fossil-db-restore: | |
# Example command: docker-compose run --rm fossildb-restore | |
fossildb-restore: |
# Example command: docker-compose run --rm fossil-db-backup | ||
fossil-db-backup: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Example command: docker-compose run --rm fossil-db-backup | |
fossil-db-backup: | |
# Example command: docker-compose run --rm fossildb-backup | |
fossildb-backup: |
volumes: | ||
- ./backups:/backups | ||
depends_on: | ||
- postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- postgres | |
postgres: | |
condition: service_healthy |
|
||
# Postgres backup | ||
postgres-backup: | ||
image: postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: postgres | |
image: postgres:15-bullseye |
# Postgres backup | ||
postgres-backup: | ||
image: postgres | ||
command: [ "/bin/bash", "-c", "PGPASSWORD=postgres pg_dump -Fc -h postgres -U postgres webknossos | gzip > /backups/backup_$(date +%Y-%m-%d_%H-%M).sql.gz" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command: [ "/bin/bash", "-c", "PGPASSWORD=postgres pg_dump -Fc -h postgres -U postgres webknossos | gzip > /backups/backup_$(date +%Y-%m-%d_%H-%M).sql.gz" ] | |
command: [ "/bin/bash", "-c", "pg_dump -Fc -h postgres -U postgres webknossos | gzip > /backups/backup_$(date +%Y-%m-%d_%H-%M).sql.gz" ] | |
environment: | |
PGPASSWORD: postgres |
Provides docker-compose steps that allow an end user to easily access and run commands for data integrity and reliability against a local fossil-db and postgres instances
Cc @kabilar
URL of deployed dev instance (used for testing):
N/A
Steps to test:
docker-compose run --rm fossil-db-backup
/persistent/fossildb/backup/private
on EC2 instancedocker-compose run --rm fossil-db-restore
to observe successful restoration(additionally, you can destroy the local
fossildb
instance and see if you can re-populate viarestore
)TODOs:
pg_dump
equivalentIssues:
(Please delete unneeded items, merge only when none are left open)