简体   繁体   中英

How to upload and deploy django cookiecutter project, with docker, to heroku?

I am developing an app with django cookiecutter (with docker and heroku setup) and have come so far as to deploying it. This is my first ever project, so no prior experience with django, docker or heroku. I've read up on it at cookiecutter docs, heroku and a little on the docker website but I still don't how to deploy.

I have downloaded the heroki cli , have set up app on heroku with my own domain and a postgres db and I am planning on getting hobby tier to get the automated certificate. All environment variables are set in the .env file and are set in the heroku config vars in my app at heoku. So everything should be alright as far as code and settings. I am also using git as version control.

Am I supposed to upload the whole project (code, settings, docker files etc) to heroku with git or by some other means? I saw there was an option to deploy the project with docker deploys aswell at herokus website . What option is the correct one?

I was thinking initially that I would just upload the project through git and run docker-compose -f production.yml up (in the heroku bash)... or something like that and that. I dont know, please help.

If some info is missing or is unclear I will try edit it as best as I can.

It is better to deploy the project to Heroku using git.

$ heroku login
$ heroku create your_custom_app_name
$ git add --a
$ git commit -m "My custom app deployment to heroku"
$ git push heroku master

and then once it is deployed.

$ heroku python manage.py migrate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM