diff --git a/Dockerfile b/Dockerfile index 8dc440b..6bfcb4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,4 @@ RUN curl -sSLO https://piair.xyz/download/chrome.deb \ ENV TZ="Europe/Paris" WORKDIR /app/MsRewards-Reborn/Flask/ -CMD gunicorn --reload -w 4 -b 0.0.0.0:6666 'app:app' +CMD bash start.sh diff --git a/config.sh b/config.sh index b2e38e0..d881116 100644 --- a/config.sh +++ b/config.sh @@ -1,8 +1,4 @@ -red=`tput setaf 1` -green=`tput setaf 2` -blue=`tput setaf 4` -reset=`tput sgr0` -echo "${blue}setting up NGINX${reset}" +echo "\n\nsetting up NGINX\n\n" rm /etc/nginx/sites-available/default echo " @@ -39,18 +35,19 @@ server { } " >> /etc/nginx/sites-available/default -echo "${green}NGINX configuration successfull${reset}" +echo "\n\nNGINX configuration successfull\n\n" service nginx restart -echo "${blue}creating sqlite databases${reset}" +echo "\n\ncreating sqlite databases\n\n" sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE daily (id INTEGER PRIMARY KEY,compte TEXT,points int,date TEXT);" sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE comptes (id INTEGER PRIMARY KEY,compte TEXT,last_pts int, banned int);" -echo "${blue}configurating grafana${reset}" +echo "\n\nconfigurating grafana\n\n" cp /app/MsRewards-Reborn/grafana-config/grafana.ini /etc/grafana/ grafana-cli plugins install frser-sqlite-datasource -service grafana-server restart +service grafana-server stop +service grafana-server start curl -X "POST" "http://localhost:3000/api/datasources" \ -H "Content-Type: application/json" \ --user admin:admin \ diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..546953a --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +service nginx start +service grafana-server start +gunicorn --reload -w 4 -b 0.0.0.0:6666 'app:app' \ No newline at end of file