From 15e68b88e8c1e58ff41f558bce7eeb3b19ff3c77 Mon Sep 17 00:00:00 2001 From: Raphael Maenle Date: Fri, 10 Jul 2020 11:47:49 +0200 Subject: [PATCH] adds uwsgi support instead of using flask dev server - uses existing wsgi.py file - adds wsgi.ini file - sets socket - defines application to be run, which it gets from wsgi.py file - uses http communication to nginx server - some random number of workers - updates Dockerfile and docker-entrypoint --- app.db | Bin 53248 -> 0 bytes docker/calendarwatch/docker-entrypoint.sh | 4 +--- wsgi.ini | 13 +++++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 app.db create mode 100644 wsgi.ini diff --git a/app.db b/app.db deleted file mode 100644 index d411f460feb45f9b56788c8e088464e7c2385be6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53248 zcmeI5OKclSdVon&)`Jq+en6`@17{g|J!4^3Qoq;_Cxe)zNQrt-mPlHU%?!6+WH;ID zZuWzeWH=jb7CGdSToNRQ0C`=51+u_ma@s>Klfz<>OOPPDn8O|xc_7)#BDn-fRg;uO zn@xKq+vA<7o@uICe^vce-(THySO0%?ac5I=l|^f}e}ic++P)WB!tckh{|QB>{~(0Lu)mGR<3Egj9Q(}~K1NOdD@a5eB7g`W z0*C-2fCwN0hyWt+1tzc;9iLmA4L{ZlSvk^%wVgVq$J~ zHvBs~t|01u(_lrDy^2by^k%l#hUk->Ch1`hUj;jN4C5+=Etxt?F~TM-o2s zevSbVu-3o;@SD=NbKjP(SpzmXtFLQ9$<$5zERE<|eZW5F6aqsnkB!e|ZU-6aEHBYN zx_Y`0o|t?8{qQ%Z{O*GR(-bwS(pGFoGmU4yUKxP#j1V&E6{{Ft^Q_SnIoSEkcA;3> zP2~%v#4|NitcH{r=-j#bK<7TVGCsHSeo*J0t&DgkAp$P3lkhSNZ}7v|Peb5;v>^hB z03v`0AOeU0B7g`W0*C-2fCwN0h`{HBKsilsvToVkd_2@S(BXQ6{RY8y1OJe*3oa|)=FAa@qPT3fbd;S z{@|dzSF9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z`?=@;u=Y0)Bb9u^F;YYIT_8s44WMD(Fq)zI-cB^^8%8r!-^-)vpMN=_sdd9_Mh>6u z3ts)0p;sM!NWk#Kz;Hkyd)48G1an>?^=!c7Kma0GB^A7x8}@r79^8Mw?q%@|y%6vt z8+$oCLlqJO;h-f0a3V%p<}DjW1bM!-Zvqc}USSfR z{E*V|lQ&y`JlbERA(9OXdR!OPifxp*WL%gsDX zS0!&vPzdeNt?lLaJGNTM*LJq?{UWnLTC00&t$c$?3EK+6Z)g=IEwH@JwfQ}3hpF*9 z$2F}joiH7HapmM_dvCXqPnxxDg(RGZl)R?4YaBGq@G$pecKuLKrdL^=8W!eGTI!+Z z*lB%5Ygae+tgW^|?QdE3UP;!QD=iW))AV}NkRGmW85^tRjZ))8<_p9Lmn}1F(px`f y8&Ee2a~~ZT|H{JL;cYJ35CKF05kLeG0Ym^1Km-s0L;w*$1P}p401@~?68L}Y0wg>D diff --git a/docker/calendarwatch/docker-entrypoint.sh b/docker/calendarwatch/docker-entrypoint.sh index 5a544db..5bb2faa 100755 --- a/docker/calendarwatch/docker-entrypoint.sh +++ b/docker/calendarwatch/docker-entrypoint.sh @@ -1,7 +1,5 @@ #!/bin/sh cd /home/calendarwatch -# uwsgi --http-socket 0.0.0.0:8084 -w wsgi --protocol=https -export FLASK_APP=/home/calendarwatch/server.py -python3 server.py +uwsgi --ini wsgi.ini echo "server has been started" diff --git a/wsgi.ini b/wsgi.ini new file mode 100644 index 0000000..543d7d2 --- /dev/null +++ b/wsgi.ini @@ -0,0 +1,13 @@ +# uwsgi --socket 0.0.0.0:8084 -w wsgi:application --protocol=http + +[uwsgi] +module = wsgi:application +protocol = http +master = true +processes = 5 + +socket = 0.0.0.0:8084 + +die-on-term = true + +