Seeing /priv/static files in Phoenix via Heroku - heroku

I just created a simple image uploading app with Phoenix using arc. Works well on my local.
I pushed the app to heroku and tried uploading an image. On the index.html (where I should see the image) I see a broken image icon with <img src="/priv/static/images/myimage.jpg">. Ok, so I need to trim away the /priv/static, but if I try to visit the image itself at https://my-app-12345.herokuapp.com/images/myimage.jpg I don't see anything.
Is there a heroku run ls command or something that I can do that tells me if I can see if the image is at least uploaded?

You can get a list of all the files by running the find . command. You can run the command on Heroku directly with heroku run find . or start a shell like sh or bash on Heroku with heroku run sh or heroku run bash and then type find ..

Related

Can't save a temporary csv file to /home/app directory on heroku using R shiny app [duplicate]

I published my first simple app on Heroku with a free dyno. This app writes a simple .txt file, that seems to be correctly written because my API services are working fine.
But if I try to check this file by entering in the file system using "heroku run bash -a MYAPP", I can't see that file in the folder I thought to see. It is like the file is not existing. Can someone tell me why?
Thanks.
I found this on https://devcenter.heroku.com/articles/active-storage-on-heroku:
In addition, any files stored on disk will not be visible from one-off dynos such as a heroku run bash instance or a scheduler task because these commands use new dynos.
It is still not so clear to me, but at least I know it is a normal (but strange) behaviour of Heroku!

No images to push error when container:push web in docker laravel heroku

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.

How see remote file list from a heroku server

I need to see all files from a heroku server from a directory. Is any anyway run command in server using command line or is there file browser heroku dashboard?
Thanks.
I could see the files from command line using the following command
heroku run ls private
But i could not find any file browser in heroku dashboard. Also we could all linux commands there by using heroku run

Parse Dashboard - works locally, blank on Heroku

I am running Parse dashboard locally - works fine
Deployed to Heroku (see references below) - it runs but does now load anything (blank screen). No errors in the log - app is up and running.
I have tried to deploy based on the following links:
Stackoverflow
Codementor
The issues came down to the bundles/ directory not being pushed correctly to git (and thus Heroku).
Make sure you run 'npm install' on your local directory
Make sure you add/commit the entire directory to git.

Setting up an existing Heroku application on a new machine

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.

Resources