I can not open the url of the site deployed with dokku - docker

Hello everybody) I started learning dokku. Going through the tutorial from the documentation for the Heroku Ruby on Rails "Getting Started" app I can't go to url generated by dokku in the browser. I am only using my local machine while learning and doing git push to localhost. This command works without errors, the container works, I get the url to the site, but I cannot open it in the browser. The same problem appears with another project, when I try to deploy a python django project, this is just a project skeleton created by django, without my code. It must show a welcome page and I want to see it when the site is running on dokku but I cannot go to the url. I tried to use dokku domains and dokku proxy but couldn't solve the problem. Please help me figure out how to fix this. I'm new to dokku, docker, nginx and deployment so the problem can be trivial. I'm also want to know on which ip, port dokku runs the sites and on which ip do I need to run the wsgi server inside the container?

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.

run rails app with an ubuntu server with global ip

Currently, we are running our rails app, on AWS but we tried to move it to Heroku, which didn't work at all, now We are trying to run the app on Virtual Machine on hetzner. I can run the app on local server easily, my question is that, How can we run our rails app with a specific IP and then we can access that app anywhere in the world from that ip? is that possible to do so? We are using PUMA for server.
Yes, you can access to to your site with specific IP.
In description of hetzner Virtual Server says that server have 1 specific IP. So than you deployed and run you application y can access to app with 1.1.1.1:80 or another port.
If i understand you. Also what happened with heroku?

What should be the url in browser when starts a rails app in amazon EC2?

I have created a rails app in Amazon EC2. After that I used
rails s
The server starts. But what should be the url to put in browser? I mean in browser, how can I view that app ? Please share with me if anyone have any idea on it.
You need to open port 3000 in amazon ec2. You will get option of adding rules, adding rule and opening port will do the job.
then
ip-address:3000 (will do job)
Got the solution. What I did is
run the server like this:
rails s -b ipaddress
And in browser: (Public DNS from amazon EC2:3000)
ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com:3000

Deploying rails app on Digital Ocean with passenger and NGINX

This is the very first app I am deploying so I'm not 100% familiar with the whole process.
Right now, all my code for the app is on my server, and if i run rails s and bind it to my droplet ip, it shows up perfectly(i.e. if i go to myipaddress:3000).
But, if I just go to myipaddress on my browser, i just get a 500 error page.
I am confused about the whole process, do i have to have my rails s running the whole time when deployed and running on the server?
If not what am I doing wrong and how can i fix it so that it just shows up when I go to my droplet ipaddress?
My nginx.conf file has its server name pointed to my droplet ip and its root pointed at my apps root folder.
Also, im not getting any errors logged into my nginx/log/error.log file
First of all you don't need to start server with rails s.
You just need to install passenger and nginx for start application with installation of ruby on rails.
And if you just want to check your app is running or not then start server with rails s into digitalocean and try to open it with browser with `ip:3000' then it will work.
From this Ref. link you can start with passenger and nginx.
Let me know if you need more help.

Setting up Rails on Hostmonster

I'm able to run rails s through ssh successfully and see the app start up just as it does on my own machine but I'm unable to access the app from the web. The app is directly under the home folder and I have a symbolic link pointing from public_html to the public folder of my rails app, just as this tutorial explains. I even tried setting up a subdomain and every other step in the tutorial to no avail. Any help would be highly appreciated.
You need an application server like Phusion Passenger, Unicorn or puma to run a Ruby app in a production environment. Typically, you'll integrate the application server into a web server's (Apache, nginx) environment.
I don't know about your hoster, but if you have root access, then you can probably use any of these application servers.
The built-in server you start by running rails server is only meant for testing purposes on your local machine. It has not been made with security, performance, stability or any other production-environment criteria in mind.

Resources