Digital Ocean with Dokku for Rails 4 and Nginx - ruby-on-rails

I recently switch from using Heroku to DigitalOcean. I have to say that nothing beats the pleasure of using Heroku, unless the concern is about server location, and price.
Deploying my existing Rails app from Heroku to Digital Ocean with Dokku is pretty smooth, but I wonder if Nginx is being used to serve the Rails app.

The answer is no. I stop Nginx, and the server is still serving the app.

Related

How to run rails applications on digitalocean using "rails s" (make it a development environment)

My issue is that I created a droplet to develop Rails apps in digitalocean .
I used the one-click rails droplet. And now I want to create more rails apps than the default rails app in this droplet.
The issue here is that it comes installed with nginx/unicorn .. And they're always on with path of default rails project in their config files.
Now let's assume I created another rails app(file) and I want to run it using "rails s" instead of default rails app that is created by the droplet. How can I do it?
Note: I don't want to change the file path in configs each time I decide to try another app
PS: I tried stopping the service of unicorn/nginx one at a time and both of them in the same time to use "rail s" to run the app .. But it didn't work .. Web pages were not loading
I know it might be a question of a rookie. But I'm kinda new to these stuff and I'd appreciate it if anyone could help me.
If you run it with rails s on the server, chances are it will be running with Puma, or if you're on an older version of Rails, Webrick. Unicorn is not involved in that case because Rails is using its own default web server. If you see that 'rails s' is not running in the right environment, it may be because RAILS_ENV is being set in your shell profile. You can override that by doing:
RAILS_ENV=development rails s
To launch your console.
That being said, rails s runs on localhost:3000 by default - and in the case you described it would be running on DigitalOcean's localhost - not yours. In order to get to it from your local machine, you would need to set up some sort of reverse proxy to allow connections to DO to get served from localhost. This is what nginx is doing for you - it's facilitating a reverse proxy.
If you want do use your DO server as a development machine for a second rails app you have, you're going to have to create that new rails app on the server, then create the reverse proxy settings in nginx to direct to it, then finally create the unicorn settings to serve it. This is an uncommon way of developing though. I recommend using your local machine to develop, and setting up Capistrano or some other deploy tool to deploy it to DO instead. You'd still need to add the settings in nginx/unicorn for the second app, but it will save you headache down the road.

Rails app with Node server on Heroku

I have a rails 5 app deployed on heroku. However, the chat features of the app is built using Node.js. While the rails app deploys fine on Heroku, the node server does not get started. How do I get the node part deployed? Does heroku allow both on a single dyno?
You can have multiple buildpacks. Here is the document that explains exactly your case https://devcenter.heroku.com/changelog-items/653

AngularJS frontend and Rails backend with AWS in Ubuntu

I would like to discuss about AngularJS and Ruby on Rails working together and deployed in AWS (Amazon Web Services).
So far, I have a development environment with an AngularJS frontend that sends request to a Ruby on Rails API backend. These both are two separate applications (they are in separated git repositories).
The AngularJS app is running in a Node.js server listening on one port, and Rails is running in a Webrick server listening on another port.
Although they work together, AngularJS is not physically integrated in the RoR app.
Now its time to deploy in production environment. For that, I will use an EC2 AWS instance (currently deploying using Elastic Beanstalk). As far as I understand, I can't have the same architecture here.
I would like to know your suggestions this point. Do you see any advantages or disadvantages?
Should I update my development environment, so the AngularJS app is integrated inside the RoR application (and deploy just one application)?
This is something I don't like, because I guess I have to modify many things.
On the other hand, is it possible to run both applications separately, the same way I do in development?
Can I install a node.js and a Unicorn or whichever server manually in production in the same instance?
I finally deployed with two separated applications as described above. The main difference is around the servers. My AngularJS frontend finally runs on an Nginx. And my Rails API is running on a Unicorn.

Sending Rails app live with Nginx on Ubuntu 10.04 Lucid box

we are following this nginx guide and we want to send our Rails app LIVE right now. what do we replace rails_env development with at 2:26 in order to send it live and not to development??
Set it to production if you want it to run in the production environment.

When to start thinking about deploying my rails app

I have been testing an app and have all of the functionality worked out. Being my first go with ror I have a few questions about my next step; grateful for direction on this.
Should I do all of the design and UI before putting my app online, or after?
In trying to research this I have found three things that keep coming up as great tools to help deploy - Heroku, Capistrano, and Phusion Passenger. I know Heroku let's you deploy quickly and easily, but is this the option if I want my app at it's own URL? I currently host other websites (Wordpress) at Hostmonster, but they aren't supporting Rails 3 yet.
What is the difference between the functionality of Passenger and Capistrano? I have been searching, but not knowing some of the terminology, I'm not sure how to decipher all of it.
Go with Heroku — there's no need to clutter your brain with all of the hosting stuff since you don't already know it. Heroku is great, and you can easily have your own domain name. Point your nameservers to a.ns.zerigo.net and b.ns.zerigo.net and run…
heroku addons:add zerigo_dns
heroku domains:add example.com
heroku domains:add www.example.com
Set your domain's DNS servers to a.ns.zerigo.net and b.ns.zerigo.net.
And done deal, you're ready to deploy on Heroku. Your first dyno (app instance) is free, Zerigo's basic dns is free. You're rolling with 2TB/bandwidth (soft limit) and a whole lotta request-serving for a grand total of $0 and 15 minutes.
And for deployment, from start to finish here (provided you develop within the limitations of Heroku's platform [ie. read-only filesystem, PostgreSQL, bundler-dependent]):
heroku create yourapp
git push heroku master
heroku open # opens yourapp.herokuapp.com in your default browser
If you need to configure your DNS records:
heroku addons:open zerigo_dns
It's like magic, but it's all just solid engineering.
And to be clear, I don't work for Heroku.
Whether to finish your UI designing before going live is a decision you have to make. I don't think this will have any rails - deployment related consequences. So if you want to deploy and release fast in a rapid manner, go ahead.
You should be able to use your own domain name even if you are hosting with heroku. Take a look at this
Capistrano lets you deploy your apps with ease. So you don't have to login to your remote server and pull code from git, restart services...etc etc. You can just run cap deploy from your workstation and everything will be deployed on your server and all services will be restarted..etc.
While passenger is something like mod_php. It hosts your application. It works with apache or nginx. You will most probably end up using both capistrano and passenger. I don't think they are comparable because they do two different things.

Resources