I have a shiny app and want to deploy it to Heroku. I tried to follow the steps as mentioned in:
https://github.com/btubbs/heroku-buildpack-shiny
I created a git Git repository and put the R files into it. Then, I created an app in heroku and tell Heroku to use a custom buildpack for my app. But, I was not be able to enable Heroku websockets support.
Error is:
Couldn't find that feature.
I can't figure out how to deal with this problem. Is there any other way to deploy the shiny app to Heroku?
Have you seen https://github.com/virtualstaticvoid/heroku-docker-r?
Check out the example shiny app too. To specify additional dependencies, you can still use init.R.
To deploy using Docker, you might have to move your current Heroku app to a container stack. This can be done with the heroku stack:set CLI command:
$ heroku stack:set container
Here's a minimal example. Basically:
Create run.R file with the following
library(shiny)
port <- Sys.getenv('PORT')
shiny::runApp(
appDir = getwd(),
host = '0.0.0.0',
port = as.numeric(port)
)
Commit to git
Create a new heroku app with
heroku create --buildpack https://github.com/virtualstaticvoid/heroku-buildpack-r.git
git push heroku master
That's all there is to it.
Another way would be to deploy using Docker. I am not an expert, but it took me a couple of days to deploy an app using this soluation. Many tutorials exist and could bring you to achieving this.
Related
I just learned about this problem so there is a bug that has not been fixed yet. For example "No images to push" when running the "heroku container:push web" command. Please help me, thanks you so much!!!
my err:
heroku.yml:
web.dockerfile:
Heroku provides two different methods for deploying with Docker that you're mixing up:
The container registry uses the heroku container:push command, but not heroku.yml.
If you wish to use this option, you need to rename your web.dockerfile to Dockerfile.web (or simply Dockerfile if it is your only image). You should also delete heroku.yml since it doesn't do anything.
Once your Dockerfile has been renamed, heroku container:push should be able to build and push your container.
Building with heroku.yml doesn't use heroku container:push.
If you wish to use this version, you'll need to follow a different set of instructions:
Make sure your heroku.yml file is committed
Tell Heroku to use the container stack:
heroku stack:set container
Deploy your code, e.g. by running git push heroku main
With this flow, Heroku will build your image from your heroku.yml file server-side.
First thing i am very new in Vue, adonis and heroku. so please tell me all the steps in answer
i have a project build in vuejs(frontend) and adonisjs api-only and i want to deploy this project on heroku with postgresql database.
What i am done till now:-
1). create a heroku account
2). create a project on heroku
3). upload frontend dist/ folder on heroku using these command
git add --all
git commit -m "initial commit"
git push heroku master
And my frontend run perfectly but i don't know how to deploy backend and how to create database
in heroku.
my working directories are
To deploy the back-end application you can do the same steps as you did for the other application.
Here's what's changing:
Add database with heroku add-ons (https://elements.heroku.com/addons/heroku-postgresql)
! When adding the add-on new heroku environment variables are created. (If they do not appear, see below)
Interesting things to know:
To execute Adonis commands : node ace <your_command> (node ace migration:run)
I advise you to use the heroku environment variables. Don't forget to add the variable ENV_SILENT = true to avoid errors because of the.env file.
Get connection db informations: (on your postgresql add-on):
Some additional information
Personal project deployed on heroku (.gitlab-ci.yml) : https://gitlab.com/CrBast/website
Interesting article : https://scotch.io/tutorials/deploying-adonisjs-apps-to-heroku
If my explanations are not clear, don't hesitate to tell me :)
I'm trying to run commands for my heroku app in my console, but it keeps telling me "Couldn't find that app." even though when I run heroku apps in my console it tells me I have one app called worldofwarcraft-api
So heroku recognizes my app in the apps list, but I can't run any commands to access it. The line I want to run is
heroku ps:scale web=1 --app worldofwarcraft-api
I'm trying to troubleshoot why my API returns a 503 when I try to make a GET request to it. This is the fix the heroku faq told me to try, but it's just telling me it can't find my app.
I'm wondering if it has something to do with the fact that I deployed my API from github, rather than running the heroku setup in my console. I don't know if that would effect my ability to run heroku commands on the app in my local console.
Apologies if my formatting is off a bit. I'm still getting used to this site.
In my case, someone renamed GitHub repo and I tried to find Heroku app with new GitHub name
It helps me
heroku apps
heroku git:remote -a YOUR_APP
Solved it. Just sharing for future searches.
The issue was fixed by running git init and then heroku git:remote -a worldofwarcraft-api in my command line while inside my repositories folder. This initialized git in the repo and then set the heroku git remote to that repository.
Hopefully, this helps anyone else who had a similar issue.
Just an easy way to solve this issue:
1st: Add the command into your terminal: $ heroku apps
If you already logged into your heroku account from your terminal, all your apps will appear as a list like this:
your-project-name-1
your-project-name-2
your-project-name-3
your-project-name-4
2nd: Then chose which one you are needing to connect with the following command:
$ heroku git:remote -a your-project-name-2
If you've done the connection properly you'll receive the following output:
set git remote heroku to https://git.heroku.com/your-project-name-2.git
For my case, I was renaming my github repository.
You can find it in your repository settings then just rename it, it appears in the first place.
Then you can continue with git init again to re-initiate your existing git repository and then set your heroku remote with your heroku apps new name heroku git:remote -a YOUR_APP_NAME
If the app belongs to a team that you participate in, you have to specify the team option in the commands to see the app:
E.g:
heroku apps -t <team name>
or
heroku ps:scale web=1 --app worldofwarcraft-api -t <team name>
I've an existing project that works fine on another machine, but I've just upgraded and from within the project development directory, everytime I run a heroku command I have to post-fix it with --app
I feel like I've missed an application setup stage, but I can't figure out what, as everytime it states:
Run this command from an app folder or specify which app to use with --app APP.
Help appreciated.
You can solve this by adding the Heroku app to your .git/config folder.
If you are in the root of your project, run the following command:
git remote add heroku git#heroku.com:appname.git
This will set a line in your .git/config file which the heroku command line tool uses to figure out what app you're using :)
In other words, your local repo doesn't have Heroku app URL configured against an app name
Similarly what we do with git remote add ( we pass git URL as a destination for push/pulling of code )
that how our git know which repo/URL to hit (push/pull from )
Heroku also follows the same method/process.
All you have to do is add Heroku app URL (so that ur Heroku command have a reference for app URL )
it will know against which URL you are running your command against
To confirm if remote named Heroku has been set for your app:
git remote -v
if not configured or if you want it for an existing app
heroku git:remote -a app_name
it's a way to link your folder to the Heroku app
The Heroku recommended way:
heroku git:remote -a my-heroku-app-id -r what-i-want-to-call-it
Source: https://devcenter.heroku.com/articles/git
Run this command from an app folder or specify which app to use with --app APP
The other answers address the first part of that statement, it is perfectly acceptable to run heroku commands in any directory. For example I have a customer facing front end project /front-end and a rails based /back-end project. I often work in the /front-end directory and if I have to connect to the production database I'll run heroku run rails c -a back-end. After I exit irb then I'm back in my desired directory.
I am upgrading my app from Rails 3.0 to Rails 3.1. To do this I need to upgrade my Heroku stack to Cedar rather than Bamboo which is currently on.
I am going through the following tutorial
and am getting stuck at the part where I deploy git push heroku master. When I run this git assumes I am pushing to my Bamboo app, when I really want to deploy to my new Cedar stack.
PhotoRambler tonybeninate$ heroku apps
photoramblr
young-river-1492
young-river-1492 is my new Cedar app, but I have no idea how to deploy to it. Can anyone advise? Thanks.
Or do I need to delete my Bamboo stack first?
No, your .git/config still thinks heroku is your old application. If you crack open that file and edit the heroku remote then it will start pushing to the right place.
have you tried checking how you added your heroku repo for the new app? ie
git remote remove heroku #to remove the link to photoramblr
git remote add heroku git#heroku.com:young-river-1492.git # to add the new one
and then
git push heroku master
You might also want to remove your bamboo app once the new once is up, otherwise you'll need to specify what app for heroku commands ie:
#instead of
heroku rake db:migrate
#you'll have to do
heroku rake db:migrate --app young-river-1492
Check out this tutorial on migrating to the Cedar stack - specifically the part on creating a new Cedar app and deploying. You're on the right track - you just need to specify which app git should push to, since you now have more than once to choose from.
Find out what the remote is called for your new app
>git remote
Push to the new remote
>git push young-river-1492-heroku young-river-1492
You can also rename your remote with git remote rename.
If you prefer, you could edit your config file instead, ala Neil's answer, or edit the config after you've successfully pushed once with the long form to make sure it works.