Skip to content

Commit 0de883e

Browse files
authored
Allow to configure uWSGI mount via environment variable (#926)
* Introduce UWSGI_MOUNT env var * Add a note to the documentation.
1 parent 7b0f8b5 commit 0de883e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ WORKDIR /webarchive
2121
ENV INIT_COLLECTION ''
2222

2323
ENV VOLUME_DIR /webarchive
24+
ENV UWSGI_MOUNT '/=/pywb/pywb/apps/wayback.py'
2425

2526
#USER archivist
2627
COPY docker-entrypoint.sh ./
@@ -31,4 +32,3 @@ EXPOSE 8080
3132

3233
ENTRYPOINT ["/docker-entrypoint.sh"]
3334
CMD ["uwsgi", "/uwsgi/uwsgi.ini"]
34-

docs/manual/usage.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ For example, to deploy pywb under the ``/wayback`` subdirectory, the ``uwsgi.ini
373373
mount = /wayback=./pywb/apps/wayback.py
374374
manage-script-name = true
375375
376+
Alternatively this can also be achieved using the `UWSGI_MOUNT` environment variable, e.g. with the value `/wayback=/pywb/pywb/apps/wayback.py`.
377+
This is specifically handy on the docker image.
376378

377379
.. _example-deploy:
378380

uwsgi.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,13 @@ env = GEVENT_MONKEY_PATCH=1
2222

2323
# specify config file here
2424
env = PYWB_CONFIG_FILE=config.yaml
25+
26+
if-not-env = UWSGI_MOUNT
2527
wsgi = pywb.apps.wayback
28+
endif =
29+
30+
# Set the path to which pywb should be mounted
31+
if-env = UWSGI_MOUNT
32+
mount = %(_)
33+
manage-script-name = true
34+
endif =

0 commit comments

Comments
 (0)