C
C
cvalex2019-06-24 16:28:24
Ruby on Rails
cvalex, 2019-06-24 16:28:24

How to create a docker image on heroku server using existing environment variables?

Hello!
I have a rails app on heroku that I need to apply docker to. I use the following way: https://devcenter.heroku.com/articles/build-docker...
I have a heroku.yml and a Dockerfile. The Dockerfile contains a layer for compiling assets RUN bundle exec rake assets:precompile. When I run git push heroku masterdocker, the image is built on the heroku side, but there are errors at the asset compilation stage due to the fact that the heroku environment variables are not available at the build stage.
If you declare environment variables in heroku.yml, then the assets compile successfully, but how do you make sure that existing heroku variables are used?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question