Skip to content

Commit

Permalink
rails 8 entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Oct 5, 2024
1 parent 4f5e052 commit fe3c83d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ gem "tzinfo-data", platforms: %i[windows jruby]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
gem "thruster", require: false

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
thruster (0.1.8)
thruster (0.1.8-aarch64-linux)
thruster (0.1.8-arm64-darwin)
thruster (0.1.8-x86_64-darwin)
thruster (0.1.8-x86_64-linux)
timeout (0.4.1)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
Expand Down Expand Up @@ -595,6 +600,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard (>= 1.35.1)
stimulus-rails
thruster
turbo-rails
tzinfo-data
view_component (~> 3.7)
Expand Down
8 changes: 7 additions & 1 deletion bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash -e

# Enable jemalloc for reduced memory usage and latency.
if [ -z "${LD_PRELOAD+x}" ]; then
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
export LD_PRELOAD
fi

# If running the rails server then create or migrate existing database
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
./bin/rails db:prepare
fi

Expand Down
5 changes: 5 additions & 0 deletions bin/thrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

load Gem.bin_path("thruster", "thrust")

0 comments on commit fe3c83d

Please sign in to comment.