Skip to content

Commit 9dfff97

Browse files
committed
[rails] Make sure redis has started before starting app server
If redis hasn't completed starting, Rails won't be able to connect to it.
1 parent c0164be commit 9dfff97

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

frameworks/Ruby/rails/rails-agoo.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ COPY . /rails/
2323
ENV RAILS_ENV=production_postgresql
2424
ENV PORT=8080
2525
ENV REDIS_URL=redis://localhost:6379/0
26-
CMD service redis-server start
27-
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)
26+
CMD service redis-server start && \
27+
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)

frameworks/Ruby/rails/rails-falcon.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ COPY . /rails/
2323
ENV RAILS_ENV=production_postgresql
2424
ENV PORT=8080
2525
ENV REDIS_URL=redis://localhost:6379/0
26-
CMD service redis-server start
27-
CMD bundle exec falcon host
26+
CMD service redis-server start && \
27+
bundle exec falcon host

frameworks/Ruby/rails/rails-mysql.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ COPY . /rails/
2323
ENV RAILS_ENV=production_mysql
2424
ENV PORT=8080
2525
ENV REDIS_URL=redis://localhost:6379/0
26-
CMD service redis-server start
27-
CMD rails server
26+
CMD service redis-server start && \
27+
rails server

frameworks/Ruby/rails/rails.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ COPY . /rails/
2323
ENV RAILS_ENV=production_postgresql
2424
ENV PORT=8080
2525
ENV REDIS_URL=redis://localhost:6379/0
26-
CMD service redis-server start
27-
CMD rails server
26+
CMD service redis-server start && \
27+
rails server

0 commit comments

Comments
 (0)