chaspy / ask-python

http://ask.chaspy.me
0 stars 0 forks source link

Deploy to heroku #3

Closed chaspy closed 5 years ago

chaspy commented 5 years ago

ref: #2

What I did

Add postgress add-on

$ heroku addons:create heroku-postgresql:hobby-dev

ref: https://elements.heroku.com/addons/heroku-postgresql

Change database at production(heroku)

By using django-heroku https://github.com/chaspy/ask-python/pull/3/commits/bd1f7db5f86c11e09c556d2f2f49f52ac7d83a7e https://github.com/chaspy/ask-python/pull/3/commits/05faf9f3008f907013884ae50e43ba3641f3a0d0

If $DATABASE_URL exists, it is automatically replace the setting. ref: https://devcenter.heroku.com/articles/django-app-configuration#settings-py-changes ref: https://github.com/heroku/django-heroku/blob/v0.3.0/django_heroku/core.py#L65-L69

$ DATABASE_URL was added as config var when installed postgress add-ons. You can see this value by heroku config

Deploy to heroku

$ heroku login
$ heroku git:remote -a askpy
$ git push heroku master

I've already pushed to heroku:master. application is working fine! https://askpy.herokuapp.com

@ariririri Please review and merge

takegawahiroto commented 5 years ago

thanks @chaspy to your fast development.

this repository doesn't work well in my local environment. image

chaspy commented 5 years ago

@takegawahiroto Please recreate image.

diff --git a/run.sh b/run.sh
index a51fa86..a1e5ae1 100755
--- a/run.sh
+++ b/run.sh
@@ -1,4 +1,4 @@
 #!/bin/bash
 set -x

-docker-compose up --force-recreate
+docker-compose up --build --force-recreate