如何使用docker将django cookiecutter项目上传和部署到heroku? [英] How to upload and deploy django cookiecutter project, with docker, to heroku?

查看:77
本文介绍了如何使用docker将django cookiecutter项目上传和部署到heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用django cookiecutter(带有docker和heroku设置)开发一个应用程序,并且到目前为止已经部署了它。这是我的第一个项目,因此没有使用django,docker或heroku的经验。我已经在cookiecutter文档,heroku和docker网站上阅读了一些内容,但仍然不知道如何部署。

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.

我已经下载了heroki cli ,已经在heroku上使用我自己的域和一个postgres db设置了应用程序,并且我计划获取业余爱好以获取自动证书。所有环境变量都在.env文件中设置,并在heoku中我的应用程序的heroku配置变量中设置。因此,就代码和设置而言,一切都应该没问题。我也使用git作为版本控制。

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.

我应该使用git或通过其他方式将整个项目(代码,设置,docker文件等)上传到heroku。 ?我看到在herokus网站上有一个选项可以使用docker deploys / a>。哪个选项才是正确的选项?

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?

我最初是想通过git上传项目,然后运行docker-compose -f production.yml(在heroku中) bash)...或类似的东西。我不知道,请帮忙。

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.

推荐答案

最好使用git将项目部署到Heroku。

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

,然后将其部署。

$ heroku python manage.py migrate

这篇关于如何使用docker将django cookiecutter项目上传和部署到heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆