Skip to content

Conversation

@sitole
Copy link
Member

@sitole sitole commented Oct 16, 2025

  • Docker build context is now set to the parent directory, so we can access the whole packages directory.
  • Moved golang package cache download before source code copy, so it will be cached always, and codebase change will not re-trigger layer cache refresh, making build much faster when you are just writing code without adding deps.

Note

Refactors Dockerfiles and Makefiles to cache Go modules and build from parent directory, removing dot-folder copies and updating paths/binaries accordingly.

  • Dockerfiles:
    • Cached deps first: Move go mod download before source copy in packages/*/Dockerfile (api, client-proxy, db, docker-reverse-proxy, orchestrator) to leverage layer caching.
    • Parent context + paths: Replace .shared/.db/.clickhouse copies with direct ./shared, ./db, ./clickhouse, ./<service> paths; adjust WORKDIRs and COPY sources accordingly.
    • Binaries/entrypoints: Normalize output locations (e.g., db migrator to ./bin/migrator) and ENTRYPOINT arrays; update final image COPY paths.
  • Makefiles:
    • Build context change: Update build-and-upload (and build) targets to use docker build ... -f ./Dockerfile .., removing temporary dot-folder creation/cleanup across api, client-proxy, db, docker-reverse-proxy, orchestrator.
    • Minor path updates to match new Dockerfile structure.

Written by Cursor Bugbot for commit 8d3aac5. This will update automatically on new commits. Configure here.

@sitole sitole added the improvement Improvement for current functionality label Oct 16, 2025
@sitole sitole changed the title Remove need for temp dot file during services build, speed docker build with cached deps Speedup docker build with cached deps, remove need for dot folders Oct 16, 2025
@sitole sitole marked this pull request as ready for review October 16, 2025 13:57
cursor[bot]

This comment was marked as outdated.

COPY ./db/client ./db/client
COPY ./db/dberrors ./db/dberrors
COPY ./db/queries ./db/queries
COPY ./db/types ./db/types
Copy link
Member

Choose a reason for hiding this comment

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

can you move this to /pkg in a next PR? 🙏🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep

@sitole sitole merged commit 484b3a8 into main Oct 16, 2025
27 checks passed
@sitole sitole deleted the chore/optimize-docker-build-speed branch October 16, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants