lib/generators/templates/litefs.yml.erb in dockerfile-rails-1.6.7 vs lib/generators/templates/litefs.yml.erb in dockerfile-rails-1.6.8
- old
+ new
@@ -75,10 +75,12 @@
# "consul". This allows the primary to change automatically when
# the current primary goes down. For a simpler setup, use
# "static" which assigns a single node to be the primary and does
# not failover.
lease:
+ promote: true
+
# Required. Must be either "consul" or "static".
type: "consul"
# Required. The URL for this node's LiteFS API.
# Should match HTTP port.
@@ -112,5 +114,21 @@
# Length of time after the lease expires before a candidate
# can become leader. This buffer is intended to prevent
# overlap in leadership due to clock skew or in-flight calls.
lock-delay: "1s"
+
+exec:
+ # Only run migrations on candidate nodes.
+ - cmd: "./bin/rails db:prepare"
+ if-candidate: true
+
+ # Then run the application server on all nodes.
+<% if !options.procfile.blank? -%>
+ - cmd: "foreman start --procfile=<%= options.procfile %>"
+<% elsif procfile.size > 1 -%>
+ - cmd: "foreman start --procfile=Procfile.prod"
+<% elsif !using_litefs? -%>
+ - cmd: <%= procfile.values.first.split(" ").inspect %>
+<% else -%>
+ - cmd: "./bin/rails server"
+<% end -%>
\ No newline at end of file