Skip to content

ISS-1594287: CI workflow optimisations#235

Open
parag-razor wants to merge 3 commits intomasterfrom
ci-optimisations
Open

ISS-1594287: CI workflow optimisations#235
parag-razor wants to merge 3 commits intomasterfrom
ci-optimisations

Conversation

@parag-razor
Copy link
Copy Markdown

Summary

  • Optimised Dockerfile layer ordering in the builder stage for better Docker build cache utilisation
  • Moved apk add and gem install bundler before any COPY instructions so OS/bundler installation is always cached
  • Separated dependency files (Gemfile.build*) from data files (data/, init.rb) so that bundle install is cached even when data files change
  • Removed debug echo statements from cached layers to keep layers clean and deterministic

Why

Previously, COPY data /app/data/ and COPY Gemfile.build* init.rb /app/ were placed before apk add and bundle install. This meant that any change to the data directory or init.rb would invalidate the cache for OS package installation and gem installation layers, causing them to re-run on every build. With this fix, those expensive layers remain cached as long as the system packages and Gemfile.build haven't changed.

Changes

  • Builder stage reordering:
    • RUN apk add redis && gem install bundler moved before any COPY (always cached)
    • COPY Gemfile.build* placed before bundle install (cached unless Gemfile.build changes)
    • COPY init.rb and COPY data moved after bundle install (cache-busting boundary)
    • Removed echo debug lines from cached layers 1 and 2

Test plan

  • Verify Dockerfile syntax is valid
  • Confirm Docker builds succeed with the reordered layers
  • Verify layer caching works (second build should skip apk/bundle install if Gemfile.build unchanged)

Generated with Claude Code docker-optimisations skill

parag-razor and others added 3 commits February 27, 2026 15:15
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nner

The razorpay/actions/docker-image-build-push composite action is a
private repo that cannot be accessed from GitHub-hosted (ubuntu-latest)
runners. Reverted to docker/build-push-action@v6 with explicit login
and buildx setup steps.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant