is there any docker image for puma? - puma

Is there any image for puma and how to use it for rails and nginx with docker-file and docker compose? because i don't want to manually setup puma service for rails production.
so puma and nginx configure correctly with rails app

Related

Why do I need to reload nginx if the webserver was down when nginx started?

I have a docker container with nginx which has in the configuration:
proxy_pass http://web:3000; # rails app started with unicorn
If I start the nginx container and after that the web container, I need to do:
docker exec nginx_container_id nginx -s reload
Whis is this necessary? And why after I start the web container the nginx wont serve my app straight away?

How to start a Rails server forever on Ubuntu

I have uploaded my Rails app on my Ubuntu server, where I want to keep my Rails server running so that any one can access it at any time.
I tried the command below to run my app:
rails server --binding=oditek.in -p 8888
Please help me to make this possible.
You can try following option to run the server in background.
rails s -d ## With default Port.
rails s -p 8888 -d ## With Custom port.
Or
nohup rails s &
Or
You can also configure your project with Nginx + Passenger

passenger start standalone with RAILS_ENV=production

I'm trying to run multiple rails apps (different versions) on my server. I followed this post
Phusion Passenger & running multiple Ruby versions
I ran one app outside the pattern with passenger standalone:
passenger start -a 127.0.0.1 -p 3000 -d
But I got this error:
database configuration does not specify adapter
(ActiveRecord::AdapterNotSpecified)
So, this app is on the development environment and I want to run as production mode.
How can I do it?
Solved! I passed now this command:
passenger start -a 127.0.0.1 -p 3000 -d --environment production

Unicorn rails server running always

I am using unicorn server for locomotive cms installed on digital ocean in ubuntu 12.04. I am wondering how I keep the server running so when I log out of the ssh session the site stays up and running.
This is currently the command I use to get it running
bundle exec unicorn_rails -p 80
Thanks! in advance
you need to set up unicorn with apache or nginx. here is a guide for apache + unicorn. with that setup you can start and stop server by starting and stopping apache service.
This is a guide on how to setup Unicorn with nginX which I have followed and used numerous times.
https://gist.github.com/billie66/3696537
Run Unicorn via bundler:
bundle exec unicorn -c config/unicorn.rb -E production -D -p 8089
Stop Unicron (if you have followed the guide from above)
kill -9 'cat /path/to/your/app/tmp/pids/unicorn.pid'

Rails deployment from foreman to supervisord

I would like to deploy my rails app, which locally runs with foreman to a server, where supervisord handles the restarts.
Unfortunatley the app throws this error and I have no idea where $PORT comes from, nor from where this part gets started. Locally everything runs nice.
My app uses redis (which is the second part in the procfile) and puma as a webserver
.../.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/uri/generic.rb:213:in 'initialize': the scheme tcp does not accept registry part: 0.0.0.0:$PORT
Check your supervisor config.
bundle exec puma -p $PORT
won't use the environment variable PORT. It should work setting the port manually.
For example:
bundle exec puma -p 3000

Resources