diff --git a/Dockerfile b/Dockerfile index a248fd4c..98be2e01 100755 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ WORKDIR /webarchive ENV INIT_COLLECTION '' ENV VOLUME_DIR /webarchive +ENV UWSGI_MOUNT '/=/pywb/pywb/apps/wayback.py' #USER archivist COPY docker-entrypoint.sh ./ @@ -31,4 +32,3 @@ EXPOSE 8080 ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["uwsgi", "/uwsgi/uwsgi.ini"] - diff --git a/docs/manual/usage.rst b/docs/manual/usage.rst index ca1119d0..762a1a14 100644 --- a/docs/manual/usage.rst +++ b/docs/manual/usage.rst @@ -373,6 +373,8 @@ For example, to deploy pywb under the ``/wayback`` subdirectory, the ``uwsgi.ini mount = /wayback=./pywb/apps/wayback.py manage-script-name = true +Alternatively this can also be achieved using the `UWSGI_MOUNT` environment variable, e.g. with the value `/wayback=/pywb/pywb/apps/wayback.py`. +This is specifically handy on the docker image. .. _example-deploy: diff --git a/uwsgi.ini b/uwsgi.ini index a1347690..b30e2e0a 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -22,4 +22,13 @@ env = GEVENT_MONKEY_PATCH=1 # specify config file here env = PYWB_CONFIG_FILE=config.yaml + +if-not-env = UWSGI_MOUNT wsgi = pywb.apps.wayback +endif = + +# Set the path to which pywb should be mounted +if-env = UWSGI_MOUNT +mount = %(_) +manage-script-name = true +endif =