From 7d3c54d2c8524a3d0c7c9da1da3ff049ecb78757 Mon Sep 17 00:00:00 2001 From: Zhai Jinyuan <15210720098@fudan.edu.cn> Date: Sun, 4 Aug 2019 16:49:54 +0800 Subject: [PATCH] add how to deploy docker file on heroku --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index c958751..5d4e659 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,28 @@ We just need store `cards.db` file, and don't need any sql command. `docker run -d -p 8000:8000 --name cs-flash-cards -v :/src/db cs-flash-cards` - Voila :) +### How to deploy docker file on heroku + +- first install [heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) +- change `entrypoint.sh` +``` +- export CARDS_SETTINGS=/src/config.txt +gunicorn --bind 0.0.0.0:$8000 flash_cards:app ++ export CARDS_SETTINGS=/src/config.txt +gunicorn --bind 0.0.0.0:$PORT flash_cards:app +``` +- deploy docker file with following commands + +```shell +heroku login +heroku container:login +heroku create +# Creating app... done, ⬢ your-app-name +heroku container:push web --app your-app-name +heroku container:release web --app your-app-name +heroku open --app your-app-name +``` + ## Alternative for Node fans [@ashwanikumar04](https://github.com/ashwanikumar04) put together an alternative flash cards site running Node: https://github.com/ashwanikumar04/flash-cards