What's a recommended/common approach to staging and production apps in Heroku, using Docker containers?

32 views
Skip to first unread message

Tom Moore

unread,
Jan 30, 2020, 7:41:01 AM1/30/20
to Django users

Hi there, 


I'm trying to set up staging and production apps in Heroku. Nothing fancy, just a way to test the app is running okay on Heroku's platform before it gets pushed to production.


The project is containerised in Docker.


I've tried setting up a pipeline in Heroku, but when I click "promote to production" on the staging app, Heroku displays an error saying that action is not supported for docker containers.


If that's true (and Docker is still popular), what is a recommended workflow for this?


The only workaround I can think of is to simply have two apps running in Heroku (project-name-staging and project-name-production) and just push the codebase to one and then the other manually from my local machine. But surely there's a better way.


Thanks very much in advance for your help.

Álvaro Durán

unread,
Jan 30, 2020, 8:10:02 AM1/30/20
to Django users
Hi Tom,
I had a similar problem a while ago using React and Django as separate containers, this tutorial helped me very much: https://dev.to/englishcraig/creating-an-app-with-docker-compose-django-and-create-react-app-31lf

I'm not aware whether that's suitable to your case, but if it is so, I put together a cookiecutter based on that tutorial that you may want to have a look at if you fancy: https://github.com/ohduran/cookiecutter-react-django

Happy to hear comments from other people on the quality of this tutorial while using Heroku.

Alvaro.

Tom Moore

unread,
Feb 7, 2020, 8:54:15 AM2/7/20
to Django users
Hi Alvaro,

Thanks very much for the suggestion, nice to understand how two containers can be set up to interact with each other.

Tom
Reply all
Reply to author
Forward
0 new messages