Skip to content

Commit

Permalink
[rails] Make sure redis has started before starting app server (#9429)
Browse files Browse the repository at this point in the history
If redis hasn't completed starting, Rails won't be able to connect to
it.
  • Loading branch information
p8 authored Dec 2, 2024
1 parent 400a993 commit a412644
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frameworks/Ruby/rails/rails-agoo.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ COPY . /rails/
ENV RAILS_ENV=production_postgresql
ENV PORT=8080
ENV REDIS_URL=redis://localhost:6379/0
CMD service redis-server start
CMD RACK_ENV=production bundle exec rackup -r agoo -s agoo -p 8080 -q -O workers=$(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)
CMD service redis-server start && \
RACK_ENV=production bundle exec rackup -r agoo -s agoo -p 8080 -q -O workers=$(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)
4 changes: 2 additions & 2 deletions frameworks/Ruby/rails/rails-falcon.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ COPY . /rails/
ENV RAILS_ENV=production_postgresql
ENV PORT=8080
ENV REDIS_URL=redis://localhost:6379/0
CMD service redis-server start
CMD bundle exec falcon host
CMD service redis-server start && \
bundle exec falcon host
4 changes: 2 additions & 2 deletions frameworks/Ruby/rails/rails-mysql.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ COPY . /rails/
ENV RAILS_ENV=production_mysql
ENV PORT=8080
ENV REDIS_URL=redis://localhost:6379/0
CMD service redis-server start
CMD rails server
CMD service redis-server start && \
rails server
4 changes: 2 additions & 2 deletions frameworks/Ruby/rails/rails.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ COPY . /rails/
ENV RAILS_ENV=production_postgresql
ENV PORT=8080
ENV REDIS_URL=redis://localhost:6379/0
CMD service redis-server start
CMD rails server
CMD service redis-server start && \
rails server

0 comments on commit a412644

Please sign in to comment.