diff --git a/gunicorn.conf.py b/gunicorn.conf.py new file mode 100644 index 0000000..d6fc8f4 --- /dev/null +++ b/gunicorn.conf.py @@ -0,0 +1,8 @@ +import os +from dotenv import load_dotenv +for env_file in ('.env', '.flaskenv'): + # make a .env path + env = os.path.join(os.getcwd(), env_file) + # if .env path exists, load .env file + if os.path.exists(env): + load_dotenv(dotenv_path=env) \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..371541e --- /dev/null +++ b/install.sh @@ -0,0 +1,18 @@ +#!/usr/bin/bash + +commit="git rev-parse --short HEAD" +bold=$(tput bold) +normal=$(tput sgr0) + +echo "--------------------------" +echo "${bold}Installing CatAsk (commit ${commit})...${normal}" +echo "--------------------------" +echo 'Creating & activating virtual environment...' +python3 -m venv venv && . venv/bin/activate +echo 'Installing required packages...' +pip install -r requirements.txt +cp .env.example .env; cp config.example.json config.json +read -n 1 -s -r -p "Press any key to open main config file" +nano config.json +read -n 1 -s -r -p "Press any key to open .env config file" +nano .env diff --git a/requirements.txt b/requirements.txt index 7ee9a39..dc2224d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ mistune bleach pathlib Flask-Compress +gunicorn