Skip to content

dataconnect(dev): add docker-compose.yml to replace bespoke bash scripts#7918

Merged
dconeybe merged 18 commits intomainfrom
dconeybe/dataconnect/compose
Mar 17, 2026
Merged

dataconnect(dev): add docker-compose.yml to replace bespoke bash scripts#7918
dconeybe merged 18 commits intomainfrom
dconeybe/dataconnect/compose

Conversation

@dconeybe
Copy link
Copy Markdown
Contributor

@dconeybe dconeybe commented Mar 16, 2026

This PR replaces custom data connect bash scripts used for sdk development and CI tests with a standard docker-compose.yml configuration.

Highlights

  • Docker Compose Integration: Introduced a docker-compose.yml file to manage the PostgreSQL and pgAdmin containers, replacing the bespoke start_postgres_pod.sh and wipe_postgres_db.sh scripts.
  • Emulator Script Updates: Modified emulator.sh to use podman compose for starting, stopping, and wiping the database containers. Added a robust health check loop to wait for the database to be ready.
  • CI Workflow Updates: Updated the GitHub Actions workflow (dataconnect.yml) to start the PostgreSQL server using docker compose rather than GitHub Actions services, and added an explicit health check step.
  • Documentation Updates: Revised the README.md to provide updated instructions on using podman compose for managing the database containers during local development.
Changelog
  • dataconnect.yml
    • Removed the postgres service definition from the job configuration.
    • Added steps to start the PostgreSQL server using docker compose up -d and wait for it to be healthy.
    • Updated the FIREBASE_DATACONNECT_POSTGRESQL_STRING environment variable.
  • README.md
    • Updated instructions to use podman compose up -d and podman compose down instead of the old bash scripts.
    • Clarified the default pgAdmin credentials and URL.
  • docker-compose.yml
    • New file defining the postgres and pgadmin services, including volume mapping and health checks.
  • emulator.sh
    • Replaced calls to wipe_postgres_db.sh and start_postgres_pod.sh with podman compose down -v and podman compose up -d.
    • Added logic to wait for the Postgres service to become healthy before continuing.
  • start_postgres_pod.sh
    • Deleted file as its functionality is now handled by Docker Compose.
  • wipe_postgres_db.sh
    • Deleted file as its functionality is now handled by Docker Compose.

…pts to launch a postgresql database for the dataconnect emulator for local sdk development
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 16, 2026

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@dconeybe
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great improvement, replacing bespoke bash scripts with a docker-compose.yml file to manage the local development database setup. This simplifies the process and makes it more declarative.

I've added a few suggestions to the docker-compose.yml file to enhance security and maintainability. These include setting a password for PostgreSQL instead of allowing trust-based authentication, avoiding hardcoded credentials for pgAdmin, and pinning the pgAdmin image version for reproducible builds.

One important point not covered in the diff: the firebase-dataconnect/emulator/README.md file still contains instructions for the old, now-deleted scripts. Please update the README to reflect the new podman compose workflow.

diff --git a/firebase-dataconnect/emulator/docker-compose.yml b/firebase-dataconnect/emulator/docker-compose.yml
index 40861c0..860f98b 100644
--- a/firebase-dataconnect/emulator/docker-compose.yml
+++ b/firebase-dataconnect/emulator/docker-compose.yml
@@ -1,6 +1,7 @@
 services:
   postgres:
-    image: docker.io/library/postgres:15
+    # https://hub.docker.com/layers/library/postgres/15/images/sha256-087b60e4987f313e00220957009a1ad57c76b26ed6d6919e5d9b047d5048a757
+    image: docker.io/library/postgres@sha256:f30e3de0ac9cc938dac627ef2231099867c694b5f949fadb924c8c977428c399
     environment:
       - POSTGRES_HOST_AUTH_METHOD=trust
     ports:
@@ -9,7 +10,8 @@ services:
       - dataconnect_pgdata:/var/lib/postgresql/data

   pgadmin:
-    image: docker.io/dpage/pgadmin4
+    # https://hub.docker.com/layers/dpage/pgadmin4/9.13.0/images/sha256-30caa6f4dac04d25eaa99a920c3095eea5f1d96d919a93994182e57442b4900a
+    image: docker.io/dpage/pgadmin4@sha256:d243a4bcc02d2ee6b447c601692813531d2d0fbca18b583d9f7f9658da835d81
     environment:
       - PGADMIN_DEFAULT_EMAIL=admin@google.com
       - PGADMIN_DEFAULT_PASSWORD=password
@dconeybe dconeybe marked this pull request as ready for review March 16, 2026 18:02
@dconeybe dconeybe changed the title dataconnect(dev): add docker-compose.yml to replace bespoke bash scripts to launch a postgresql database for the dataconnect emulator for local sdk development dataconnect(dev): add docker-compose.yml to replace bespoke bash scripts Mar 17, 2026
@dconeybe dconeybe merged commit fa3c4a3 into main Mar 17, 2026
467 of 476 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/compose branch March 17, 2026 15:29
@github-actions github-actions bot mentioned this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants