Skip to content

fix(core): Rails loses storage/ on every redeploy and installs its gems twice - #468

Merged
Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
a-abdellatif98:feat/rails-stack-registry
Sep 16, 2026
Merged

Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
a-abdellatif98:feat/rails-stack-registry

Conversation

@a-abdellatif98

@a-abdellatif98 a-abdellatif98 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Rails deployments currently discard storage/, repeat bundle install, and precompile without the production environment/dummy secret used by Rails' generated Dockerfile. Preserve storage through the existing stack-volume mechanism and correct the default build/start commands. The existing Ruby detector also reads resolved Gemfile.lock dependencies without treating constraints as installed gems.

Adapted the original contribution to the current integration branch in #892. The final change uses existing stack/detection primitives and keeps migrations in the application image. Release phases and new process roles remain separate work under #231.

Validation: 1,059 core tests and 224 API language/stack-detection cases pass. Nine new regression cases fail against current main. Real Ruby image/build validation is handled with the companion build-recipe repair in #469.

A Gemfile names direct dependencies only, so transitive gems were invisible
to stack detection. The lockfile carries what bundler actually resolved,
with exact versions and the RUBY VERSION stanza.

parseRubyVersion is exported but unused here; it is what will let the build
image follow the project's pinned Ruby instead of a hardcoded 3.3.
storage/ is where a stock Rails 8 app keeps both the SQLite database and
Active Storage's disk service, so every redeploy silently discarded them.
Rails' own Dockerfile declares `VOLUME /rails/storage`; laravel already
declares the same path here for the same reason.

The build command also opened with `bundle install`, which stack-detector
already runs as the install step, and precompiled without RAILS_ENV or the
SECRET_KEY_BASE_DUMMY that Rails' Dockerfile sets. Start command now binds
$PORT rather than falling back to 3000.
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.

2 participants