{"id":20548854,"url":"https://github.com/jlandure/alpine-firestore-backup","last_synced_at":"2025-04-14T10:53:41.362Z","repository":{"id":63739886,"uuid":"199608862","full_name":"jlandure/alpine-firestore-backup","owner":"jlandure","description":"Image that performs Firestore backups based on Alpine Google Cloud SDK image.","archived":false,"fork":false,"pushed_at":"2020-12-05T12:09:05.000Z","size":54,"stargazers_count":25,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T15:37:27.397Z","etag":null,"topics":["cloud-scheduler","docker","firestore-backup-image","gcp","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/zenika/alpine-firestore-backup","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlandure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-30T08:26:01.000Z","updated_at":"2024-10-31T15:28:59.000Z","dependencies_parsed_at":"2022-11-25T01:53:23.538Z","dependency_job_id":null,"html_url":"https://github.com/jlandure/alpine-firestore-backup","commit_stats":null,"previous_names":["jlandure/alpine-firestore-backup"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlandure%2Falpine-firestore-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlandure%2Falpine-firestore-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlandure%2Falpine-firestore-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlandure%2Falpine-firestore-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlandure","download_url":"https://codeload.github.com/jlandure/alpine-firestore-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868773,"owners_count":21174757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-scheduler","docker","firestore-backup-image","gcp","hacktoberfest"],"created_at":"2024-11-16T02:15:02.258Z","updated_at":"2025-04-14T10:53:41.334Z","avatar_url":"https://github.com/jlandure.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker Build Status](https://img.shields.io/docker/cloud/build/zenika/alpine-firestore-backup.svg)](https://hub.docker.com/r/zenika/alpine-firestore-backup/) [![Docker Pulls](https://img.shields.io/docker/pulls/zenika/alpine-firestore-backup.svg)](https://hub.docker.com/r/zenika/alpine-firestore-backup/) [![Layers](https://images.microbadger.com/badges/image/zenika/alpine-firestore-backup.svg)](https://microbadger.com/images/zenika/alpine-firestore-backup) [![Version](https://images.microbadger.com/badges/version/zenika/alpine-firestore-backup.svg)](https://microbadger.com/images/zenika/alpine-firestore-backup)\n\n# Supported tags and respective `Dockerfile` links\n\n- `latest`, `268.0.0` [(Dockerfile)](https://github.com/Zenika/alpine-firestore-backup/blob/master/Dockerfile)\n- from `267.0.0` to `256.0.0` (all listed versions [here](https://hub.docker.com/r/zenika/alpine-firestore-backup/tags))\n\n# alpine-firestore-backup\n\nImage that performs Firestore backups based on `google/cloud-sdk:alpine` image.\n\n# Why this image\n\nWe use a lot of Firebase features like Firestore.\nBut there is no simple way to backup the data.\n\nThis image aims to be used inside the Google Cloud Platform to perform backups automatically.\n\n[See this article for more information.](https://dev.to/zenika/how-to-backup-your-firestore-data-automatically-48em)\n\n# Prerequisites\n\n## Create a bucket on GCP\n\nCreate a [GCP coldline bucket](https://cloud.google.com/storage/docs/storage-classes) and save the name of your bucket.\n\n## Create a service account\n\nCreate a [GCP Service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) with the following rights:\n\n- `Cloud Datastore Import Export Admin`\n- `Storage Admin`\n\n## Prepare your env variables for Cloud Run\n\nPlease fill in the following information:\n\n- `GCLOUD_PROJECT_ID`\n- `GCLOUD_BUCKET_NAME`\n\n# 3 ways to create your image ready to use on Cloud Run\n\n## 1. Use the Cloud Run Button\n\nPlease give a feedback on this **new** way to deploy it ✨\n\n*For this deployment, the new service account can't be used. Simply grant the default (\u003cproject_id\u003e-compute@developer.gserviceaccount.com) service account with the required roles*\n\n[![Run on Google Cloud](https://storage.googleapis.com/cloudrun/button.svg)](https://console.cloud.google.com/cloudshell/editor?shellonly=true\u0026cloudshell_image=gcr.io/cloudrun/button\u0026cloudshell_git_repo=https://github.com/Zenika/alpine-firestore-backup)\n\n## 2. Use a public image\n\nYou can use the public `gcr` image available on `gcr.io/zenika-hub/alpine-firestore-backup`\nWe publish the image in the 4 container registries to be available in the closest region:\n\n- Global: `gcr.io/zenika-hub/alpine-firestore-backup`\n- Europe: `eu.gcr.io/zenika-hub/alpine-firestore-backup`\n- Asia: `asia.gcr.io/zenika-hub/alpine-firestore-backup`\n- US: `us.gcr.io/zenika-hub/alpine-firestore-backup`\n\n## 3. Create your own image\n\nYou can also create your own image from the repository to be independant. But you have to maintain the update of your image by yourself.\n\nTo do this, clone this repository:\n\n```sh\ngit clone https://github.com/zenika/alpine-firestore-backup.git\n```\n\nBuild:\n\n```sh\ndocker image build -t gcr.io/[GCLOUD_PROJECT_ID]/alpine-firestore-backup\n```\n\nPush using [Container Registry Authentication](https://cloud.google.com/container-registry/docs/advanced-authentication):\n\n```sh\ngcloud auth configure-docker\ndocker push gcr.io/[GCLOUD_PROJECT_ID]/alpine-firestore-backup\n```\n\n# 3 ways to set up your Cloud Run service\n\n[Cloud Run](https://cloud.google.com/run/docs/deploying) is a serverless service to automatically serve your containers using http.\n\n## 1. Use the Cloud Run Button\n\nIt will deploy it automatically.\n\n## 2. Use the CLI\n\nIf you're fan of CLI, please use the following command to create your `Cloud Run` service:\n\n```\ngcloud beta run deploy alpine-firestore-backup\\\n    --project=my-awesome-project\\\n    --platform=managed\\\n    --region=europe-west1\\\n    --image=zenika-hub/alpine-firestore-backup\\\n    --memory=256Mi\\\n    --allow-unauthenticated\\\n    --set-env-vars GCLOUD_PROJECT_ID=VALUE,GCLOUD_BUCKET_NAME=VALUE\\\n    --service-account=my-service-account@my-awesome-project.iam.gserviceaccount.com\n```\n\nCheck the deployment using the following command:\n\n```\ngcloud beta run services list\\\n    --project my-awesome-project\\\n    --platform managed\\\n    --region=europe-west1\\\n```\n\n## 3. Use the WebUI\n\nIn the [WebUI console](http://console.cloud.google.com/run), create a `Cloud Run service` using the public image `gcr.io/zenika-hub/alpine-firestore-backup` or your own image `gcr.io/[GCLOUD_PROJECT_ID]/alpine-firestore-backup`.\n\nBe careful to:\n\n- Choose your newly image in `latest`\n- Choose \"Cloud Run (fully managed)\" and a location\n- Enter a service name\n- Select \"Allow unauthenticated invocations\"\n- In the \"Show optional settings / Environment variables\", set the 3 environment variables seen in the previous section\n- In the \"Service account\" part, select your previously created service account\n\n![cloud-run](https://user-images.githubusercontent.com/525974/62141405-ce9e0800-b2ec-11e9-8763-45efddb4c55d.png)\n\n# Test and validate\n\nYou can test the service using your browser: `https://alpine-firestore-backup-XXX-run.app/`\n\nSave the url created to call your Cloud Run Service.\nFor example: `https://alpine-firestore-backup-XXX-run.app/backup`\n\n# Schedule it with Cloud Scheduler\n\n[Cloud Scheduler](https://cloud.google.com/scheduler/docs/) allow you to schedule a cronjob in order to call a https endpoint at regular intervals.\n\nPrepare a `Cloud Scheduler` to send a request to your `Cloud Run Service` every time you need.\n\nFor example, every Monday at 3:00am `0 3 * * 1`\n\n![cloud-scheduler](https://user-images.githubusercontent.com/525974/62141536-02792d80-b2ed-11e9-80fe-b81466cb862d.png)\n\n# Monitor the backup operations\n\nYou can also check the current status of each backup operation using the following url `https://alpine-firestore-backup-XXX-run.app/list`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlandure%2Falpine-firestore-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlandure%2Falpine-firestore-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlandure%2Falpine-firestore-backup/lists"}