docker-rails-example
docker-rails-example copied to clipboard
Deploy to Heroku
Here is my repo: https://github.com/AJuliette/journees-du-patrimoine I tried @paulofabiano's solution, but I'm still getting a precompiling assets failed. Could someone give me a hand ?
Is everything running in a container through Heroku?
Just the other week someone reported that it's working here https://github.com/nickjj/docker-rails-example/issues/82 after following the solution you linked.
I'm sorry, I don't have an ops background. I just created an app and linked it to my github repo and tried to deploy main.
You mentioned following the steps in the solution, but the solution mentions creating a heroku.yml file which runs the app in a container. Did you perform that step?
Yes it's there: https://github.com/AJuliette/journees-du-patrimoine/blob/main/heroku.yml
Thanks.
I don't use Heroku personally but I wonder if it'll work if you change the .yarnrc file from --modules-folder /node_modules to --modules-folder /tmp/node_modules. To go along with that change you'll want to update the Dockerfile to change the (3) spots where /node_modules is referenced to /tmp/node_modules. They are on lines 19 and 33.
Can you try doing that, rebuilding and see if things work?
It buids locally but it still fails on Heroku (with a different error !):
Which soution do you use ? I just want to put this on prod ^^"
That error indicates esbuild cannot be found. Truthfully I don't know why Heroku isn't using the correct image. It's possible something has changed in the year or so since that answer was provided. You may want to Google around how to get Heroku and multi-stage builds to work with Heroku.
I typically deploy my apps to a virtual private server, such as a $10 / month DigitalOcean server and use Docker Compose to run the app.