Right way to deploy Rails + Puma + Postgres app to Elastic beanstalk?
<p>I have an Rails 5 API which I am trying to deploy(correctly) on Elastic Beanstalk.</p>

<p>Here is my initial <code>config/puma.rb</code> file which I use:</p>

<pre><code>threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
port        ENV.fetch("PORT") { 3000 }

# Specifies the `environment` that Puma will run in.
environment ENV.fetch("RAILS_ENV") { "development" }

# Allow puma to be restarted by `rails restart` command.

plugin :tmp_restart
</code></pre>

<p>I get the following socket error:</p>

<pre><code>2015/11/24 06:44:12 [crit] 2689#0: *4719 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream
</code></pre>

<p>To fix this I tried adding below lines and got it to work:</p>

<pre><code>rails_env = ENV['RAILS_ENV'] || "production"
if rails_env == "production"
  bind "unix:///var/run/puma/my_app.sock"
  pidfile "/var/run/puma/my_app.sock"
end
</code></pre>

<p>My real question is, is this the right way to do it? If anyone has done it before can you point me to it? Is there a way to do this via docker containers?</p>