Search code examples
dockerherokuplotly-dash

Set the stack for an existing heroku app from heroku-18 to 'container' for a Docker image?


I am trying to find a way to set the stack to 'container' so I can deploy my app in a docker image rather than heroku-18. Reasons for this are complicated, but necessary.

The Heroku Docker image setup docs say I can do this in my app.json file, like so:

"stack": "container"

but doing this causes an error when deploying through the online interface:

 !     No default language could be detected for this app.
            HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
            See https://devcenter.heroku.com/articles/buildpacks
 !     Push failed

Are there other ways to set the stack to container? For e.g., according to these docs it may also be possible to set this using the Dockerfile, but it's not clear exactly how to do this.

I know I can use the heroku CLI, but I'd prefer to set this up in my git repo as this app will be deployed to other users also.

Thanks in advance for any advice!


Solution

  • To set the stack to container using the command line (as an alternative to editing app.json), I believe

    heroku stack:set container
    

    will do the trick. You can read more about deploying containers on Heroku here (see Step 3 of Getting Started for the syntax above):

    https://devcenter.heroku.com/articles/build-docker-images-heroku-yml