How can I deploy to production webpack+Rails? - ruby-on-rails

I want to deploy my project in production, but I can find information how to do it, I follow this information to created my website: rails+webpack, and just say for heroku but I am not using heroku.
I will really appreciate if you can help me with this issue.

You might not be understanding what Heroku is, you can easily use Heroku to deploy your website by following the steps mentioned in the same guide you posted. Using the command git push heroku master will deploy your application to a unique Heroku address which you can open by using heroku open in the CLI.
So first you'll need to create a Heroku account and then download the Heroku CLI which is just an interface to use Heroku from the command line. And here's a great guide on how to deploy a Rails 5 application to Heroku, Heroku might seem a bit scary at first for beginners but it really is very simple.

Related

How do I deploy a Dockerized multi-image JS app to Heroku?

I want to deploy a simple web app to Heroku.
The front-end, back-end, and database of my web app are bundled together with docker-compose.
The Heroku documentation says that typing heroku container:push web should be sufficient to push my app to Heroku, once I have created the appropriate images with docker-compose. This doesn't work for me: the Keroku CLI tells me No images to push.
Adding a -a myAppName tag doesn't help either, nor do other posts on Stack Overflow.
I would prefer not to try this solution, as it would pollute my source control with Heroku-specific configuration.
What can I do to understand what is not working and why?
Docker compose on Heroku is just for local development. You should look at heroku.yml for deployment. Reference. Heoku.yml

Using Heroku with Ruby on Rails

I have two questions about general usage with Heroku and RoR:
1) after I deploy my application onto Heroku, how can I apply new changes that I make?
2) After I deploy my application to Heroku, how do I "turn off" the server so that I can run my app locally again via localhost:3000? (for development & testing purposes)
Thanks!
Assuming you are using git to manage your project, you apply changes to Heroku by pushing them. This might look something like this:
git push heroku master
This pushes the master branch of your git project to Heroku.
To "turn off" your app on Heroku, you can do two things:
$ heroku ps:scale web=0
This completely turns off the application. You can also put it in maintenance mode, which simply prevents traffic to it:
$ heroku maintenance:on
That said, you don't need to turn off your app on Heroku while developing locally. The two environments are completely independent of each other.
Hope this link helps for part 1. Should be able to commit and push your changes using git push heroku master.
https://devcenter.heroku.com/articles/git#tracking-your-app-in-git
For part 2: will scaling your dynos back to 0 work for your case?
How to stop an app on Heroku?
When you make a change, just push the git repository to heroku again withgit push heroku master.
The server will automatically restart with the changed system.
You seem to have a misconception. You can always run your local development server regardless of what Heroku is doing (unless some other service your app connects to would become confused, of course; but if that happens, there is probably something wrong with your design). Nonetheless, if you want to stop the application on Heroku, just scale it to zero web dynos: heroku ps:scale web=0.

Creating and deploying new Heroku applications with a Rails application hosted on Heroku

I have a rails application running on heroku. I would like to make that application to create & deploy other applications on heroku.
Since the Cedar stack allows writing to the filesystem I can generate the files needed for the new application. My question is how to issue the "heroku create" and "git push heroku master" commands for deployment.
Is there any gems out there / can I use the heroku CLI in heroku together with the ruby system call?
You can do everything that you need to do Heroku wise with the Heroku gem. Bear in mind though that this will need credentials to authenticate, so you'll need to be happy with storing these in the applications config.
From a git point of view, use ruby-git.
It's probably worth looking at making whatever it is you're making multi-tenanted so you don't have to worry about this problem, and also won't have to worry about hundreds of applications to maintain (updates, bugfixes and the like)

What to do after Rails deployment?

I am am a newbie in Ruby on Rails development and I am learning this fantastic framework fast and easy. The only problem (which is a big one) is how to deploy.
I have tried a Linode StackScript which installs Ruby, Rails, Passenger and Nginx and I have made a "cap deploy" and all files was sent to the server but how on earth do I get this public. When I visit my website (IP) it seems to be down or not responding. Is there anything I need to do after deployment to make my app available to the web?
Thankful for all help, I really want to slay the deployment beast!
For ease of deployment, and scalability, have you looked at Heroku instead of hosting your own server?
That would make the process of deploying as simple as git push heroku

How do you deploy your Rails application?

Do you upload your rail application to your host via FTP first?
I'm currently using Passenger and Capistrano. If I do "cap deploy" in my local machine then I think Capistrano should upload my rail application to my host, right?
Someone from my host is saying that I need to run "cap deploy" in server. I think it doesn't make sense.
You should be able to run cap deloy on your local machine and that should get the current version of your software to the server. However, you need to set up first how this is supposed to happen. I for example use Git to manage my code and also use it to get my software on the server. However, you could also use SVN or FTP if you prefer that. If you google for Capistrano together with the Software youbeant to transfer the code with and maybe even your hosting providers name, you probably will find a decent step by step explanation. For me John Numemaker's post on deploying with Capistrano and Git on Dreamhost really helped: http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/
As an alternative you also might want to check out heroku.com. Their smallest offer is free and enough for most projects. The deployment process is so easy a monkey could deploy a Rails app on their platform. I generally can only recommend heroku.

Resources