Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fly-apps/dockerfile-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.6.25
Choose a base ref
...
head repository: fly-apps/dockerfile-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.7.8
Choose a head ref

Commits on Jan 5, 2025

  1. Add --litestream as an option

    rubys committed Jan 5, 2025
    Copy the full SHA
    a276650 View commit details
  2. restore litefs test

    rubys committed Jan 5, 2025
    Copy the full SHA
    6dfc362 View commit details
  3. Merge pull request #126 from fly-apps/125-add-litestream-as-an-option

    Add --litestream as an option
    rubys authored Jan 5, 2025
    Copy the full SHA
    647e9c1 View commit details
  4. Copy the full SHA
    f8842ee View commit details
  5. Merge pull request #128 from fly-apps/127-make-jemalloc-the-default-r…

    …ails-8-parity
    
    Make --jemalloc the default (Rails 8 parity)
    rubys authored Jan 5, 2025
    Copy the full SHA
    8f08937 View commit details
  6. comment sync with Rails 8

    rubys committed Jan 5, 2025
    Copy the full SHA
    be77ea0 View commit details
  7. Copy the full SHA
    257c539 View commit details
  8. Copy the full SHA
    3c4b668 View commit details
  9. Copy the full SHA
    4ba7040 View commit details
  10. Copy the full SHA
    cf77e59 View commit details
  11. Copy the full SHA
    8d2aad2 View commit details
  12. fix litestream entrypoint

    rubys committed Jan 5, 2025
    Copy the full SHA
    59234dc View commit details

Commits on Jan 6, 2025

  1. Copy the full SHA
    da650c7 View commit details

Commits on Jan 14, 2025

  1. Copy the full SHA
    dbc89da View commit details
  2. Copy the full SHA
    c031e0e View commit details
  3. check for ffi

    rubys committed Jan 14, 2025
    Copy the full SHA
    126e29f View commit details
  4. Merge pull request #131 from fly-apps/130-slim-and-alpine-dependency-…

    …updates-in-base-ruby-images
    
    Slim and alpine dependency updates in base ruby images
    rubys authored Jan 14, 2025
    Copy the full SHA
    36cde77 View commit details
  5. Copy the full SHA
    ea8f996 View commit details
  6. Search for ffi in the gemfile

    rubys committed Jan 14, 2025
    Copy the full SHA
    7e3a8a1 View commit details
  7. Merge pull request #132 from fly-apps/ffi

    Search for ffi in the gemfile
    rubys authored Jan 14, 2025
    Copy the full SHA
    96b88b6 View commit details

Commits on Jan 15, 2025

  1. Detect Bun with new test-based lockfile

    In version 1.1.39, Bun added a new text-based lockfile (`bun.lock`)[1]
    which will become the standard in version 1.2. The Bun check should
    account for this as well as the existing `bun.lockb`.
    
    [1]: https://bun.sh/blog/bun-v1.1.39#bun-lock-is-bun-s-new-text-based-lockfile
    neanias committed Jan 15, 2025
    Copy the full SHA
    6264eaa View commit details
  2. Merge pull request #134 from neanias/support-new-bump-lockfile

    Detect Bun with new test-based lockfile
    rubys authored Jan 15, 2025
    Copy the full SHA
    ca1e730 View commit details
  3. Copy the full SHA
    4eea3a8 View commit details
  4. Merge pull request #135 from collectiveidea/alpine-no-cache

    Use apk add --no-cache to consolidate install on alpine
    albus522 authored Jan 15, 2025
    Copy the full SHA
    dbb7a4a View commit details
  5. Fix alpine vips package

    albus522 committed Jan 15, 2025
    Copy the full SHA
    6040a2f View commit details
  6. update CI to 3.4

    rubys committed Jan 15, 2025
    Copy the full SHA
    44b0cfd View commit details

Commits on Jan 20, 2025

  1. Merge pull request #137 from fly-apps/ruby-3.4

    update CI to 3.4
    rubys authored Jan 20, 2025
    Copy the full SHA
    4d00147 View commit details
  2. Merge pull request #136 from collectiveidea/fix-alpine-vips

    Fix alpine vips package
    rubys authored Jan 20, 2025
    Copy the full SHA
    684bb45 View commit details
  3. v1.7.3 [ci skip]

    rubys committed Jan 20, 2025
    Copy the full SHA
    f4caddc View commit details

Commits on Jan 21, 2025

  1. Merge pull request #129 from danielmorrison/patch-1

    Recover from a database parse failure
    rubys authored Jan 21, 2025
    Copy the full SHA
    088a953 View commit details
  2. restore rubocop

    rubys committed Jan 21, 2025
    Copy the full SHA
    104f1fa View commit details

Commits on Jan 28, 2025

  1. Add missing bun.lock checks to copy text-based lockfile (#139)

    * Add missing bun.lock checks to copy text-base lockfile
    
    * Default to .lock
    luizkowalski authored Jan 28, 2025
    Copy the full SHA
    dc0b603 View commit details
  2. Copy the full SHA
    c3fd09a View commit details

Commits on Jan 31, 2025

  1. v1.7.5 [ci skip]

    rubys committed Jan 31, 2025
    Copy the full SHA
    4ff732a View commit details

Commits on Feb 5, 2025

  1. Copy the full SHA
    8e0f50e View commit details

Commits on Feb 6, 2025

  1. Merge pull request #142 from brkn/patch-1

    Readme - Fix Litestream link text [ci skip]
    rubys authored Feb 6, 2025
    Copy the full SHA
    4d15004 View commit details
  2. Clean up bin/docker-entrypoint server check when running litestream

    Remove what launches the sever (thrust, litestream) from the check
    to see if we are running the server.  That makes the check more
    resilient to environment changes (example: not running thruster on
    fly.io).
    rubys committed Feb 6, 2025
    Copy the full SHA
    fa7fa37 View commit details
  3. appease rubocop

    rubys committed Feb 6, 2025
    Copy the full SHA
    379d181 View commit details
  4. Copy the full SHA
    d035c64 View commit details
  5. Docker image change was reverted - libyaml is back in

    Still include libyaml in the Dockerfile (as Rails does), but
    no longer complain if it is missing.
    rubys committed Feb 6, 2025
    Copy the full SHA
    333d7f1 View commit details
  6. Merge pull request #144 from fly-apps/libyaml-no-longer-required

    Docker image change was reverted - libyaml is back in
    rubys authored Feb 6, 2025
    Copy the full SHA
    9fd268a View commit details
  7. Merge pull request #143 from fly-apps/cleanup-litestream-entrypoint

    Clean up bin/docker-entrypoint server check when running litestream
    rubys authored Feb 6, 2025
    Copy the full SHA
    c58097b View commit details
  8. v1.7.6 [ci skip]

    rubys committed Feb 6, 2025
    Copy the full SHA
    f48c9f2 View commit details

Commits on Feb 20, 2025

  1. Copy the full SHA
    a001570 View commit details
  2. appease rubocop

    rubys committed Feb 20, 2025
    Copy the full SHA
    e505a3f View commit details

Commits on Feb 21, 2025

  1. Copy the full SHA
    4f19d3c View commit details
  2. Merge pull request #146 from fly-apps/libyaml-ruby-3.4.2

    require libyaml-dev for Ruby >= 3.4.1
    rubys authored Feb 21, 2025
    Copy the full SHA
    2fb907d View commit details
  3. Merge pull request #145 from fly-apps/pick-only-one-database

    Pick only one database.
    rubys authored Feb 21, 2025
    Copy the full SHA
    78843dd View commit details
  4. v1.7.7 [ci skip]

    rubys committed Feb 21, 2025
    Copy the full SHA
    7207cfd View commit details

Commits on Feb 24, 2025

  1. Copy the full SHA
    76fd6bc View commit details
Showing with 1,442 additions and 625 deletions.
  1. +1 −1 .github/workflows/alpine.yml
  2. +1 −1 .github/workflows/ci.yml
  3. +2 −2 .github/workflows/rubocop.yml
  4. +1 −1 .github/workflows/system-test.yml
  5. +11 −0 README.md
  6. +1 −1 dockerfile-rails.gemspec
  7. +15 −8 lib/dockerfile-rails/scanner.rb
  8. +105 −32 lib/generators/dockerfile_generator.rb
  9. +28 −16 lib/generators/templates/Dockerfile.erb
  10. +2 −0 lib/generators/templates/_apt_install.erb
  11. +10 −6 lib/generators/templates/docker-entrypoint.erb
  12. +16 −2 lib/generators/templates/dockerignore.erb
  13. +55 −0 lib/generators/templates/litestream.rake.erb
  14. +21 −19 test/results/alpine/Dockerfile
  15. +7 −1 test/results/alpine/docker-entrypoint
  16. +23 −14 test/results/api/Dockerfile
  17. +21 −12 test/results/bin_cd/Dockerfile
  18. +16 −2 test/results/bun/.dockerignore
  19. +24 −15 test/results/bun/Dockerfile
  20. +21 −13 test/results/cache/Dockerfile
  21. +21 −12 test/results/ci/Dockerfile
  22. +21 −12 test/results/config/Dockerfile
  23. +21 −12 test/results/env/Dockerfile
  24. +16 −2 test/results/esbuild/.dockerignore
  25. +23 −14 test/results/esbuild/Dockerfile
  26. +22 −18 test/results/execjs_importmap/Dockerfile
  27. +22 −18 test/results/execjs_node/Dockerfile
  28. +21 −12 test/results/fullstaq/Dockerfile
  29. +21 −13 test/results/grover/Dockerfile
  30. +21 −13 test/results/idle/Dockerfile
  31. +7 −1 test/results/idle/docker-entrypoint
  32. +23 −16 test/results/jemalloc/Dockerfile
  33. +8 −0 test/results/jemalloc/docker-entrypoint
  34. +21 −12 test/results/label/Dockerfile
  35. +24 −11 test/results/litefs/Dockerfile
  36. +7 −1 test/results/litefs/docker-entrypoint
  37. +81 −0 test/results/litestream/Dockerfile
  38. +14 −0 test/results/litestream/docker-entrypoint
  39. +14 −0 test/results/litestream/fly.toml
  40. +16 −2 test/results/minimal/.dockerignore
  41. +21 −12 test/results/minimal/Dockerfile
  42. +23 −14 test/results/mysql/Dockerfile
  43. +22 −9 test/results/nginx/Dockerfile
  44. +7 −1 test/results/nginx/docker-entrypoint
  45. +21 −12 test/results/no_precompiled_gems/Dockerfile
  46. +21 −12 test/results/no_prep/Dockerfile
  47. +6 −0 test/results/no_prep/docker-entrypoint
  48. +23 −14 test/results/parallel/Dockerfile
  49. +23 −14 test/results/postgresql/Dockerfile
  50. +16 −2 test/results/precompile_defer/.dockerignore
  51. +21 −12 test/results/precompile_defer/Dockerfile
  52. +7 −1 test/results/precompile_defer/docker-entrypoint
  53. +16 −2 test/results/private_gemserver/.dockerignore
  54. +21 −12 test/results/private_gemserver/Dockerfile
  55. +16 −2 test/results/private_gemserver_with_cache/.dockerignore
  56. +21 −13 test/results/private_gemserver_with_cache/Dockerfile
  57. +23 −14 test/results/redis/Dockerfile
  58. +22 −9 test/results/rmagick/Dockerfile
  59. +16 −2 test/results/shrine/.dockerignore
  60. +21 −12 test/results/shrine/Dockerfile
  61. +23 −14 test/results/sidekiq/Dockerfile
  62. +23 −14 test/results/solid_queue_postgres/Dockerfile
  63. +23 −14 test/results/solid_queue_sqlite3/Dockerfile
  64. +23 −14 test/results/sqlite3/Dockerfile
  65. +21 −12 test/results/swap/Dockerfile
  66. +7 −1 test/results/swap/docker-entrypoint
  67. +23 −14 test/results/thruster/Dockerfile
  68. +23 −14 test/results/trilogy/Dockerfile
  69. +16 −2 test/results/vite/.dockerignore
  70. +21 −12 test/results/vite/Dockerfile
  71. +21 −12 test/results/windows/Dockerfile
  72. +21 −12 test/results/yjit/Dockerfile
  73. +2 −2 test/test_config.rb
  74. +1 −1 test/test_fullstaq.rb
  75. +2 −1 test/test_jemalloc.rb
  76. +1 −1 test/test_litefs.rb
  77. +1 −1 test/test_litestack.rb
  78. +18 −0 test/test_litestream.rb
2 changes: 1 addition & 1 deletion .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
- run: sudo apt install libvips-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
ruby-version: '3.4'
bundler-cache: true
- run: gem install rails
- run: rake test:alpine
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
- run: sudo apt install libvips-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
ruby-version: '3.4'
bundler-cache: true
- run: gem install rails
- run: rake test
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Ruby 3.3
- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler-cache: true

- name: Run RuboCop
2 changes: 1 addition & 1 deletion .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
- run: sudo apt install libvips-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
ruby-version: '3.4'
bundler-cache: true
- run: gem install rails
- run: rake test:system
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ are actually using. But should you be using DATABASE_URL, for example, at runti
additional support may be needed:

* `--litefs` - use [LiteFS](https://fly.io/docs/litefs/)
* `--litestream` - use [Litestream](https://litestream.io/)
* `--mysql` - add mysql libraries
* `--postgresql` - add postgresql libraries
* `--redis` - add redis libraries
@@ -119,6 +120,16 @@ Options are saved between runs into `config/dockerfile.yml`. To invert a boolea

## Testing

Run:

Installation:

```
brew install postgresql mysql zstd
bundle config --local build.mysql2 "--with-opt-dir="$(brew --prefix zstd)""
bundle install
```

A single invocation of `rake test:all` will run all of the tests defined. dockerfile-rails has are three types of tests:

* `rake test:rubocop` runs [rubocop](https://github.com/rubocop/rubocop) using the same options as the Rails codebase.
2 changes: 1 addition & 1 deletion dockerfile-rails.gemspec
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "dockerfile-rails"
spec.version = "1.6.25"
spec.version = "1.7.8"
spec.authors = [
"Sam Ruby",
]
23 changes: 15 additions & 8 deletions lib/dockerfile-rails/scanner.rb
Original file line number Diff line number Diff line change
@@ -43,23 +43,30 @@ def scan_rails_app

### database ###

# start by checkout config/database.yml. It defaults to sqlite3,
# but we can't rely on that because DATABASE_URL can override it.
# if we see anything else, assume the change was intentional.
database = YAML.load_file("config/database.yml", aliases: true).
dig("production", "adapter") rescue nil

if database == "sqlite3"
@sqlite3 = true
elsif database == "postgresql"
if database == "postgresql"
@postgresql = true
elsif (database == "mysql") || (database == "mysql2") || (database == "trilogy")
@mysql = true
elsif database == "sqlserver"
@sqlserver = true
end

@sqlite3 = true if @gemfile.include? "sqlite3"
@postgresql = true if @gemfile.include? "pg"
@mysql = true if @gemfile.include?("mysql2") || using_trilogy?
@sqlserver = true if @gemfile.include?("activerecord-sqlserver-adapter")
## if not found (or sqlite3), check the Gemfile
elsif @gemfile.include? "pg"
@postgresql = true
elsif @gemfile.include?("mysql2") || using_trilogy?
@mysql = true
elsif @gemfile.include?("activerecord-sqlserver-adapter")
@sqlserver = true
elsif @gemfile.include?("sqlite3") || database == "sqlite3"
# check this one last as sqlite3 may be used in development
@sqlite3 = true
end

### node modules ###

Loading