Closed takumiabe closed 5 years ago
Why don't you put port number configuration to config/puma.rb?
@minimum2scp Thank you for comment!
sorry, It is (my personal) too complex case, :( I have many sub-app on a single service under loadbalancer. (I call them A, B ,C here)
then, I want to setup this case:
from deploy/staging.rb
from deploy/production.rb
I think it is difficult to implement this case by only config/puma.rb (neither ENV inside puma.rb)
thanks
@takumiabe Thanks, I understand.
I found that I can access server properties by backend.host.properties
(an instance of Capistrano::Configuration::Server::Properties),
so maybe you can set port number by backend.host.properties.fetch(:puma_port)
in config/systemd/puma.service.erb.
...
[Service]
...
ExecStart=bundle exec puma -C <%= current_path %>/config/puma.rb -p <%= backend.host.properties.fetch(:puma_port) %>
...
Please try.
@minimum2scp Ohh, It works! (Sorry, I searched by "server", but by "host")
Thank you for better solution!
this change can do like this:
config/deploy/xxxx.rb
config/systemd/puma.service.erb
I update a lot of rspecs, but I'm not sure it is right... :(