From 5920966b869cdf9f6b5ee7fe15410b238ba147b9 Mon Sep 17 00:00:00 2001 From: miles tomlinson Date: Fri, 11 Dec 2020 12:22:01 +0000 Subject: [PATCH] deploying app to Heroku --- .gitignore | 1 + Makefile | 9 ++++++++- Procfile | 1 + requirements.txt | 1 + setup.py | 1 + setup.sh | 15 +++++++++++++++ 6 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 setup.sh diff --git a/.gitignore b/.gitignore index 3081f55..bd09325 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ star-project-key.json eggs/ .eggs/ *.egg +__pycache__/ diff --git a/Makefile b/Makefile index ae1e8d4..1b46154 100644 --- a/Makefile +++ b/Makefile @@ -57,4 +57,11 @@ pypi_test: @twine upload -r testpypi dist/* -u lologibus2 pypi: - @twine upload dist/* -u lologibus2 \ No newline at end of file + @twine upload dist/* -u lologibus2 + +# ---------------------------------- +# RUN STREAMLIT +# ---------------------------------- + +run_streamlit: + streamlit run fivestar/five_star.py diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..fe5dd28 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: sh setup.sh && streamlit run fivestar/five_star.py diff --git a/requirements.txt b/requirements.txt index fbcdcb8..07bc4f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,3 +19,4 @@ memoized_property psutil termcolor wordcloud +streamlit==0.71.0 diff --git a/setup.py b/setup.py index 1be8c57..57f23b8 100644 --- a/setup.py +++ b/setup.py @@ -15,3 +15,4 @@ include_package_data=True, scripts=['scripts/fivestar-run'], zip_safe=False) + diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..10743ff --- /dev/null +++ b/setup.sh @@ -0,0 +1,15 @@ +mkdir -p ~/.streamlit/ + +echo "\ +[general]\n\ +email = \"${milestommo87@gmail.com}\"\n\ +" > ~/.streamlit/credentials.toml + +echo "\ +[server]\n\ +headless = true\n\ +enableCORS = false\n\ +port = $PORT\n\ +" > ~/.streamlit/config.toml + +