Repository navigation
feat(relay): add docker support and publish workflow [Closes #352] - #356
Conversation
|
@nneelabh02 is attempting to deploy a commit to the jo-duchan's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR updates Docker packaging and publishing: it filters the build context, refactors the Dockerfile into pnpm-based builder/runtime stages, and adds a GitHub Actions workflow to build and publish a multi-architecture image. ChangesDocker build and publish pipeline
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/docker-publish.yml:
- Around line 20-21: The Docker publish workflow is missing the
multi-architecture platform list, so the image is not built for both requested
targets. Update the build/publish configuration in the docker-publish workflow,
specifically around the `docker/setup-buildx-action` and the downstream build
step, to include `linux/amd64` and `linux/arm64` as `platforms` so the published
image is built for both architectures.
- Around line 23-33: The Docker publish workflow is using the wrong secret names
and image repository for the publish contract. Update the docker/login-action@v3
and docker/metadata-action@v5 configuration to use DOCKERHUB_USERNAME and
DOCKERHUB_TOKEN, and change the image target from the current relay repository
path to tapflow/tapflow so the publish steps align with the expected Docker Hub
setup.
In `@Dockerfile`:
- Around line 10-16: The Docker build context is missing some workspace
manifests before pnpm install, so the monorepo graph in the image does not match
the repo graph. Update the Dockerfile near the COPY and pnpm install steps to
include the top-level playground and docs manifests (as referenced by
pnpm-workspace.yaml and .dockerignore) alongside packages before running pnpm
install, so workspace resolution includes all declared projects.
- Around line 6-7: The Dockerfile currently installs pnpm without respecting the
repo’s pinned version, which can make the build pick up a newer incompatible
release. Update the pnpm installation step to use the exact version pinned by
the project, preferably via Corepack or an explicit [email protected] install, so the
build behavior matches the packageManager setting and stays stable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f602c2b7-6305-4a54-b018-455f673b7902
📒 Files selected for processing (3)
.dockerignore.github/workflows/docker-publish.ymlDockerfile
- Pin pnpm version to 9.15.1 in Dockerfile - Include playground and docs package.json files for complete workspace resolution - Add QEMU setup and configure linux/amd64,linux/arm64 multi-platform builds - Use DOCKERHUB_USERNAME / DOCKERHUB_TOKEN to match issue contract - Adjust Docker image target to tapflow/tapflow
|
Thanks for the follow-up commit — pinning I actually built the image locally (colima + buildx, PR HEAD 1.
2. Once Node is bumped, the root The build context excludes 3. Heads-up: because Verified working configuration (built + booted successfully —
One more suggestion: since Really nice direction overall (multi-stage + |
- Bump base image to node:22-alpine in Dockerfile to satisfy native deps like better-sqlite3 without a toolchain - Safe-guard the prepare hook with 'lefthook install || true' in package.json to prevent errors when building outside a git repo - Add pull_request trigger in docker-publish.yml to catch build errors early on PRs - Make Docker Hub login and pushing conditional on push events only
|
@jo-duchan The feedbad has been implemented, kindly check the PR. Thank you |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package.json (1)
16-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider gating on
.gitpresence instead of blanket suppression.
|| truemasks alllefthook installfailures, including legitimate ones in normal (non-Docker) git clones — not just the "no.gitdir" case this was meant to fix. A developer with a broken lefthook install would silently get no git hooks with no signal.♻️ Suggested refactor
- "prepare": "lefthook install || true", + "prepare": "[ -d .git ] && lefthook install || true",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 16, The prepare script currently suppresses every lefthook install failure by using the package.json "prepare" hook with a blanket fallback. Update the script to only skip installation when there is no .git directory, and let real lefthook failures surface normally. Use the existing "prepare" entry in package.json and gate the lefthook install command on .git presence instead of relying on || true.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package.json`:
- Line 16: The prepare script currently suppresses every lefthook install
failure by using the package.json "prepare" hook with a blanket fallback. Update
the script to only skip installation when there is no .git directory, and let
real lefthook failures surface normally. Use the existing "prepare" entry in
package.json and gate the lefthook install command on .git presence instead of
relying on || true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 513e1903-5576-4d40-b5f7-1ff1f9bfa5dd
📒 Files selected for processing (3)
.github/workflows/docker-publish.ymlDockerfilepackage.json
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/docker-publish.yml
- Dockerfile
Please check the vercel deploy. @jo-duchan |
|
Thanks @nneelabh02 — everything checks out. ✅
I'm going to merge this now. Really appreciate the thorough, well-structured contribution — the multi-stage build, If tapflow has been useful to you, a ⭐️ on the repo would mean a lot and helps others discover the project: https://github.com/jo-duchan/tapflow |

Resolves #352
This PR introduces production-ready Docker deployment support for the
@tapflowio/relaypackage along with an automated GitHub Action workflow to publish the image to Docker Hub.Changes Included
@tapflowio/agent-core). Usespnpm deployto prune development dependencies and correctly package the relay service into a minimal runtime image.nodeuser on a lightweightnode:20-alpinebase image..dockerignoreto prevent sending unneeded files (such as.git,.github(via ignore), and.changeset) to the Docker daemon..github/workflows/docker-publish.yml) that automatically builds and pushes the image to Docker Hub on pushes tomainor upon creating a release tag. It securely uses repository secretsDOCKER_USERNAMEandDOCKER_TOKENand leverages GitHub Actions caching for faster builds.Summary by CodeRabbit
New Features
Bug Fixes
preparestep tolerant tolefthook installfailures.Improved Packaging