From 49f157436b6c4d6c38efc64df3cee3b2adb09ecc Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 22 Aug 2023 13:33:43 +0200 Subject: [PATCH] ofc i need to commit --- Dockerfile | 10 ++++++++-- Flask/app.py | 2 +- build.sh | 2 +- config.sh | 19 +++++++++++++++++++ dev_build.sh | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 config.sh diff --git a/Dockerfile b/Dockerfile index 269fd52..8dc440b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,14 @@ RUN curl -sSLO https://piair.xyz/download/chrome.deb \ && git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn \ && python3 -m pip install -r MsRewards-Reborn/requirements.txt \ && apt update \ - && apt install xvfb nano tzdata wfrench tigervnc-standalone-server libasound2 libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 libdbus-1-3 xdg-utils fonts-liberation libdrm2 -y \ + && apt install xvfb nginx nano tzdata sqlite3 apt-transport-https software-properties-common wget wfrench tigervnc-standalone-server libasound2 libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 libdbus-1-3 xdg-utils fonts-liberation libdrm2 -y \ + && wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \ + && echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list \ + && apt update \ + && apt install grafana \ + && bash MsRewards-Reborn/config.sh \ && dpkg -i chrome.deb + ENV TZ="Europe/Paris" WORKDIR /app/MsRewards-Reborn/Flask/ -CMD gunicorn --reload -w 4 -b 0.0.0.0:1234 'app:app' +CMD gunicorn --reload -w 4 -b 0.0.0.0:6666 'app:app' diff --git a/Flask/app.py b/Flask/app.py index dea8dd2..6cd37c4 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -472,4 +472,4 @@ def proxy(): if __name__ == '__main__': update_jobs() edit_version() - app.run(host='0.0.0.0', port=6666, debug=True) + app.run(host='0.0.0.0', port=1234, debug=True) diff --git a/build.sh b/build.sh index 22dec17..cfb86c2 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -sudo docker build --no-cache -t msrewards . && sudo docker run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name Dev msrewards +sudo docker build --no-cache -t msrewards . && sudo docker run -d --restart unless-stopped -p 1234:1234 -ti --shm-size=2gb --name MsRewards msrewards diff --git a/config.sh b/config.sh new file mode 100644 index 0000000..f7db9b5 --- /dev/null +++ b/config.sh @@ -0,0 +1,19 @@ +rm /etc/nginx/sites-available/default +echo " +server { + listen 1234; + server_name localhost; + location / { + proxy_set_header X-Forwarded-For \$remote_addr; + proxy_set_header Host \$http_host; + proxy_pass "http://127.0.0.1:6666"; + } + location /stats { + proxy_pass http://localhost:3000; + rewrite ^/stats/(.*) /\$1 break; + proxy_set_header Host \$host; + } +} +" >> /etc/nginx/sites-available/default +service nginx restart +service grafana start \ No newline at end of file diff --git a/dev_build.sh b/dev_build.sh index c54af8b..f049d65 100644 --- a/dev_build.sh +++ b/dev_build.sh @@ -1 +1 @@ -sudo docker build --no-cache -t msrewards-dev . && sudo docker run -p 3456:3456 -ti --shm-size=2gb --name Dev msrewards-dev +sudo docker build --no-cache -t msrewards-dev . && sudo docker run -p 5555:1234 -ti --shm-size=2gb --name Dev2 msrewards-dev