feat: standalone Docker build for duckpipe-daemon#25
Merged
Conversation
Add a lightweight daemon-only Docker image (Dockerfile.daemon) so the daemon can be deployed independently from PostgreSQL. Includes CI to build multi-arch images and publish to pgducklake/duckpipe-daemon. - Add --api-bind CLI arg (default 127.0.0.1) for container use - Support CONNSTR env var for --connstr via clap env attribute - Parameterize fetch-ducklake-ext.sh with DUCKDB_HOME for reuse - Add duckpipe_daemon targets to docker-bake.hcl - Add daemon build+merge jobs to CI workflow - Add docker-compose.daemon.yml example deployment - Exclude benchmark/ and .claude/ from Docker build context Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove clang/libclang-dev from daemon builder (only needed by pgrx) - Split extension download into separate ext-fetcher stage so BuildKit can run it in parallel with cargo build - Merge two extension COPY layers into one (consolidated in ext-fetcher) - Type api_bind as IpAddr instead of String for parse-time validation - Enable clap "env" feature for CONNSTR env var support - Remove unnecessary docker pull moby/buildkit from daemon CI job Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aad1c2c to
0945b1f
Compare
The daemon runs a standalone DuckDB instance (not pg_duckdb), so it needs both ducklake and postgres_scanner as separate .duckdb_extension files. Add FETCH_POSTGRES_SCANNER flag to fetch-ducklake-ext.sh — the PG image skips it (pg_duckdb bundles its own), the daemon image enables it (upstream version is safe outside PG backends). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
libduckdb.so dynamically links against libcurl for HTTP operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PG 18 changed the data directory layout to use major-version-specific subdirectories. The mount must be at /var/lib/postgresql, not /var/lib/postgresql/data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…SION dependency - Move Dockerfile, Dockerfile.daemon, docker-bake.hcl, and compose files into docker/ for cleaner root directory - Remove PG_VERSION matrix from daemon CI (daemon is PG-agnostic) - Use internal _BUILDER_PG ARG in Dockerfile.daemon to consolidate the hardcoded PG version into a single-line default - Narrow CI path trigger to avoid rebuilds on compose-only changes - Fix mixed comment style in docker-bake.hcl Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move _BUILDER_PG ARG to top of Dockerfile.daemon (Docker requires global ARGs before the first FROM instruction) - Add file: docker/Dockerfile to both build steps in ci.yaml since the Dockerfile moved from root to docker/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Dockerfile.daemon— lightweight multi-stage build (builder compiles against pg_ducklake's libduckdb, runtime is debian:bookworm-slim with non-rootduckpipeuser)--api-bindCLI arg (default127.0.0.1) so containers can bind to0.0.0.0CONNSTRenv var for--connstrvia clapenvattribute for cleaner Docker Compose usagedocker/fetch-ducklake-ext.shwithDUCKDB_HOMEenv var so it works for both PG and daemon imagesduckpipe_daemon/duckpipe_daemon_18targets todocker-bake.hcldocker_build_daemon+docker_merge_daemonCI jobs (multi-arch amd64/arm64, publishes topgducklake/duckpipe-daemon)docker-compose.daemon.ymlexample: PG db + standalone daemon with healthcheckbenchmark/and.claude/from.dockerignoreTest plan
docker build -f Dockerfile.daemon -t duckpipe-daemon .builds successfullydocker run --rm duckpipe-daemon --helpshows CLI help with--api-bindand--connstr/CONNSTRdocker compose -f docker-compose.daemon.yml up -dstarts both servicescurl localhost:8080/healthreturns healthy from the daemon containerDockerfilebuild is unaffected (fetch-ducklake-ext.shdefaults unchanged)Dockerfile.daemonchanges and builds both image types in parallel🤖 Generated with Claude Code