ソースを参照

[rails] Make sure redis has started before starting app server (#9429)

If redis hasn't completed starting, Rails won't be able to connect to
it.
Petrik de Heus 8 ヶ月 前
コミット
a412644733

+ 2 - 2
frameworks/Ruby/rails/rails-agoo.dockerfile

@@ -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)

+ 2 - 2
frameworks/Ruby/rails/rails-falcon.dockerfile

@@ -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

+ 2 - 2
frameworks/Ruby/rails/rails-mysql.dockerfile

@@ -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

+ 2 - 2
frameworks/Ruby/rails/rails.dockerfile

@@ -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