{"id":16695100,"url":"https://github.com/davidmyersdev/docker-firebase-tools","last_synced_at":"2025-09-04T01:31:42.658Z","repository":{"id":43894452,"uuid":"277137999","full_name":"davidmyersdev/docker-firebase-tools","owner":"davidmyersdev","description":"A docker container for firebase-tools with firebase emulator suite","archived":false,"fork":false,"pushed_at":"2022-07-08T02:42:54.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T06:25:12.289Z","etag":null,"topics":["cli","docker","emulator","firebase","firebase-emulators","firebase-tools"],"latest_commit_sha":null,"homepage":"https://firebase.google.com/docs/cli","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidmyersdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-04T15:38:13.000Z","updated_at":"2024-12-16T19:06:56.000Z","dependencies_parsed_at":"2022-08-28T18:32:54.053Z","dependency_job_id":null,"html_url":"https://github.com/davidmyersdev/docker-firebase-tools","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/davidmyersdev/docker-firebase-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fdocker-firebase-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fdocker-firebase-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fdocker-firebase-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fdocker-firebase-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidmyersdev","download_url":"https://codeload.github.com/davidmyersdev/docker-firebase-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fdocker-firebase-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539243,"owners_count":25123494,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","docker","emulator","firebase","firebase-emulators","firebase-tools"],"created_at":"2024-10-12T17:05:19.550Z","updated_at":"2025-09-04T01:31:42.624Z","avatar_url":"https://github.com/davidmyersdev.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-firebase-tools\n\nA docker container for https://firebase.google.com/docs/cli - aka firebase-tools\n\n##  Usage\n\n### TLDR\n\nRunning the container will run `firebase --non-interactive emulators:start`. The `firebase.json` file included in this project will start a Firestore emulator (at port `8080`), an Auth emulator (at port `9099`), and the Emulator Suite UI (at port `4000` - if you pass a project id). To override this behavior, you can provide your own config files [using the instructions below](#use-your-own-firebase-config).\n\n### Docker Run\n\n```shell\ndocker run --rm -it -e FIREBASE_PROJECT_ID=project-123 -p 4000:4000 -p 8080:8080 -p 9099:9099 voraciousdev/firebase-tools\n```\n\n#### Firebase CLI Authorization\n\nhttps://firebase.google.com/docs/cli#cli-ci-systems\n\nGenerate the authorization URL.\n\n```shell\n# port 9005 is required for the oauth redirect\ndocker run --rm -it -e FIREBASE_PROJECT_ID=project-123 -p 9005:9005 voraciousdev/firebase-tools login:ci\n```\n\nThis should give you a URL similar to the following.\n\n```\nhttps://accounts.google.com/o/oauth2/auth?client_id=abc-123.apps.googleusercontent.com\u0026scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform\u0026response_type=code\u0026state=123\u0026redirect_uri=http%3A%2F%2Flocalhost%3A9005\n```\n\nVisit this URL on your host machine to authorize Firebase CLI via OAuth. After authorizing, you should see an auth token in your terminal.\n\nRun the docker container with the auth token as `FIREBASE_TOKEN` to use any `firebase-tools` features that require authorization. This token can be reused across containers, but you can always generate a new one by following the steps above.\n\n```shell\ndocker run --rm -it -e FIREBASE_TOKEN=token-123 -e FIREBASE_PROJECT_ID=project-123 -p 4000:4000 -p 8080:8080 -p 9099:9099 voraciousdev/firebase-tools\n```\n\n### Docker Compose\n\nThings will be pretty similar for Docker Compose, but you will need to setup some configuration. Here is an example `docker-compose.yml` with a separate `.env` for your credentials. I recommend following the same steps above to generate your auth token if you need it.\n\n```yaml\n# docker-compose.yml\nversion: '3.1'\nservices:\n  firebase:\n    container_name: firebase\n    environment:\n      - FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}\n      - FIREBASE_TOKEN=${FIREBASE_TOKEN}\n    image: voraciousdev/firebase-tools\n    ports:\n      - 4000:4000 # emulator suite ui\n      - 8080:8080 # firestore\n      - 9099:9099 # auth\n    stdin_open: true\n    tty: true\n    volumes:\n      - .:/firebase/volume\n```\n\n```shell\n# .env\nFIREBASE_PROJECT_ID=project-123\nFIREBASE_TOKEN=your-oauth-token\n```\n\nOnce your project is configured, you can just run it like normal.\n\n```shell\ndocker-compose up\n```\n\n### Use your own Firebase config\n\nIf you want to use your own firebase configuration, you just need to mount a volume with your config files. This image has already been setup to accept a volume mounted at `/firebase/volume` in your container. For these examples, let's assume you have the following files on your host machine at `/home/firebase`.\n\n```js\n// firebase.json\n\n{\n  \"firestore\": {\n    \"rules\": \"firestore.rules\"\n  },\n  \"emulators\": {\n    \"auth\": {\n      \"host\": \"0.0.0.0\",\n      \"port\": 1234\n    },\n    \"firestore\": {\n      \"host\": \"0.0.0.0\",\n      \"port\": 2345\n    },\n    \"ui\": {\n      \"enabled\": true,\n      \"host\": \"0.0.0.0\",\n      \"port\": 3456\n    }\n  }\n}\n```\n\n```js\n// firestore.rules\n\nservice cloud.firestore {\n  match /databases/{database}/documents {\n    // Allow only authenticated content owners access\n    match /some_collection/{userId}/{documents=**} {\n      allow read, write: if request.auth != null \u0026\u0026 request.auth.uid == userId\n    }\n  }\n}\n```\n\nNote the alternative ports chosen.\n\n#### Docker Run\n\nNote the matching port bindings and the new `-v` argument. The host path is `/home/firebase` and the guest path (in your container) is `/firebase/volume`.\n\n```shell\ndocker run --rm -it -e FIREBASE_PROJECT_ID=project-123 -v /home/firebase:/firebase/volume -p 1234:1234 -p 2345:2345 -p 3456:3456 voraciousdev/firebase-tools\n```\n\n#### Docker Compose\n\nNote the matching port bindings and the new `volumes` key. The host path is `/home/firebase` and the guest path (in your container) is `/firebase/volume`.\n\n```yaml\n# docker-compose.yml\nversion: '3.1'\nservices:\n  firebase:\n    container_name: firebase\n    environment:\n      - FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}\n      - FIREBASE_TOKEN=${FIREBASE_TOKEN}\n    image: voraciousdev/firebase-tools\n    ports:\n      - 1234:1234 # auth\n      - 2345:2345 # firestore\n      - 3456:3456 # emulator suite ui\n    stdin_open: true\n    tty: true\n    volumes:\n      - /home/firebase:/firebase/volume\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmyersdev%2Fdocker-firebase-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmyersdev%2Fdocker-firebase-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmyersdev%2Fdocker-firebase-tools/lists"}