File tree 4 files changed +45
-2
lines changed
4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 17
17
'libcap-dev (>= 1:2.66)' \
18
18
'libpcre3-dev (>= 2:8.39)' \
19
19
'uwsgi-core (>= 2.0.21)' \
20
- 'uwsgi-src (>= 2.0.21)'
20
+ 'uwsgi-src (>= 2.0.21)' \
21
+ 'inotify-tools (>= 3.22.6.0)'
21
22
22
23
/usr/bin/uwsgi --build-plugin "/usr/src/uwsgi/plugins/psgi"
23
24
EOT
56
57
COPY --from=build-uwsgi /psgi_plugin.so /usr/lib/uwsgi/plugins/psgi_plugin.so
57
58
COPY --from=build-perl /usr/local/lib/perl5 /usr/local/lib/perl5
58
59
COPY --from=build-perl /usr/local/bin /usr/local/bin
59
- COPY wait-for-it.sh /
60
+ COPY watcher.sh uwsgi.sh wait-for-it.sh /
61
+ COPY uwsgi.ini /etc/uwsgi.ini
Original file line number Diff line number Diff line change
1
+ [uwsgi]
2
+ master = true
3
+ workers = 20
4
+ early-psgi = true
5
+ perl-no-die-catch = true
6
+ disable-logging = true
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ script_dir=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) "
4
+ pid=" $$ "
5
+ uwsgi_ini=" /etc/uwsgi.ini"
6
+
7
+ if [[ " $PLACK_ENV " == " development" ]]; then
8
+ if [[ -e ' /etc/uwsgi-development.ini' ]]; then
9
+ uwsgi_ini=" /etc/uwsgi-development.ini"
10
+ fi
11
+ (
12
+ set -m
13
+ " $script_dir /watcher.sh" " $pid " lib * .conf &
14
+ )
15
+ fi
16
+
17
+ exec /usr/bin/uwsgi \
18
+ --plugins psgi \
19
+ --http-socket-modifier1 5 \
20
+ --ini /etc/uwsgi.ini \
21
+ " $@ " \
22
+ --psgi app.psgi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ pid=" $1 "
6
+ shift
7
+
8
+ inotifywait --event create --event delete --event modify --event move \
9
+ -m --format ' %w%f' -r " $@ " | \
10
+ while read modify; do
11
+ printf ' %s\n' " Detected change to $modify , reloading uWSGI..."
12
+ kill -HUP " $pid "
13
+ done
You can’t perform that action at this time.
0 commit comments