47135 backend [ configuration ] Fix dockerignore#222
Merged
Conversation
pneumojoseph
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Description
File uploads (POST
/workflows/attachments) fail in production with "Cloud service: get_new_file_urls exception" (Sentry error, 10 events / 3 users in 1 hour). No user can upload attachments to workflows.Root cause:
google_api_credentials.jsonis excluded from the Docker image bybackend/.dockerignore, sostorage.Client()(Google Cloud SDK) cannot find credentials to generate signed URLs.2. Context
PR #216 (
46858_add_copy_instruction_backend_dockerfile) expandedbackend/.dockerignoreand addedgoogle_api_credentials.jsonwith the comment "should be mounted, not baked in". However, in the production deploy (Ansible), the file is not mounted — it is copied by theapp_copy_credentials_filesrole into the build directory, thenADD . /pneumatic_backend/inDockerfile.j2includes it in the image. The.dockerignoreexclusion broke this chain.3. Solution
Remove
google_api_credentials.jsonfrombackend/.dockerignoreso the file is included in the Docker image during production builds.4. Implementation Details
backend/.dockerignore5. What to Test
5.1 Preconditions
5.2 Positive Scenarios
docker exec -it backend-prod shls -la /pneumatic_backend/google_api_credentials.json5.3 Negative Scenarios
5.4 Verification Points
/pneumatic_backend/google_api_credentials.jsonexistsdocker run --rm <image> ls /pneumatic_backend/google_api_credentials.jsonget_new_file_urls exceptionevents5.5 What Was NOT Tested
firebase-push.jsonwas not affected6. Affected Areas
.dockerignorechange affects only production Docker image builds. Does not affect local development, tests, or CI/CD pipeline.7. Refactoring
None.
8. Commits
d4f741ea— hotfix(docker): allow GCS credentials into Docker image9. Release Notes
Fixed: File uploads were failing with "Cloud service exception" because GCS credentials were excluded from the Docker image by
.dockerignore.Note
Medium Risk
Bakes Google Cloud service account credentials into the production image again, which increases credential exposure if images leak but is required for the current Ansible copy-into-image deploy model.
Overview
Restores inclusion of
google_api_credentials.jsonin production Docker images by removing its entry frombackend/.dockerignore.That file is expected at
/pneumatic_backend/google_api_credentials.json(viaGOOGLE_APPLICATION_CREDENTIALS) for GCS signed URLs during workflow attachment uploads. Excluding it brokestorage.Client()in production and surfaced as Cloud service: get_new_file_urls exception; the deploy path copies credentials into the build context rather than mounting them at runtime.Reviewed by Cursor Bugbot for commit d4f741e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Include
google_api_credentials.jsonin backend Docker build contextRemoves the
google_api_credentials.jsonexclusion rule from backend/.dockerignore so the file is included in the Docker build context.Macroscope summarized d4f741e.