Skip to content

Commit 1ba1f32

Browse files
committed
Feat: dispatcher based event processing
1 parent 6198719 commit 1ba1f32

14 files changed

Lines changed: 628 additions & 109 deletions

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN apk --no-cache add openssl && \
1111
gcc libc-dev openssl-dev linux-headers libffi-dev && \
1212
pip install --no-cache-dir -r /requirements.txt && \
1313
rm -f /requirements.txt && apk del .build-deps && \
14-
ln -s /app/getssl /bin/getssl && ln -s /app/verify /bin/verify && \
14+
ln -s /app/getssl /bin/getssl && ln -s /app/verify /bin/verify && ln -s /app/reload /bin/reload && \
1515
mv /docker-entrypoint.sh /nginx-entrypoint.sh && \
1616
ln -s /app/docker-entrypoint.sh /docker-entrypoint.sh
1717
RUN rm -rf /var/log/nginx/* && chown nginx:nginx /var/log/nginx && truncate -s 0 /etc/nginx/conf.d/default.conf
@@ -26,4 +26,4 @@ ENV LETSENCRYPT_API=${LETSENCRYPT_API} \
2626
DEFAULT_HOST=true \
2727
VHOSTS_TEMPLATE_DIR=/app/vhosts_template
2828
WORKDIR /app
29-
COPY . /app/
29+
COPY . /app/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ docker exec nginx-proxy verify www.example.com ## check if request routes back t
250250
251251
docker exec nginx-proxy getssl www.example.com example.com www2.example.com # issue certificate
252252
253+
docker exec nginx-proxy reload # rescan Docker state and reload nginx config
254+
253255
```
254256

255257
## 🚀 Roadmap

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ def receiveSignal(signalNumber, frame):
1717
app.stop()
1818
app = None
1919
sys.exit(0)
20+
if signalNumber == signal.SIGHUP:
21+
print("\nReload Requested")
22+
if app is not None:
23+
app.reload()
2024

2125

2226
signal.signal(signal.SIGTERM, receiveSignal)
27+
signal.signal(signal.SIGHUP, receiveSignal)
2328

2429

2530
def setup_debug_mode():

0 commit comments

Comments
 (0)