From f059bb7d8f132ffda300eccabc3315bed656aacc Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Thu, 1 Sep 2022 15:14:11 -0500 Subject: [PATCH] Update to use `/var/moin` instead of `/var/www`. In my previous deployments, I've had more success using a custom directory instead of repurposing the traditional webroot directory. This is more generally a FYI that I am putting together a final commit to this repository. I need to start migrating to `moin2`. --- Dockerfile | 15 +++++++-------- Makefile | 7 +++++-- moinmoin/moin.wsgi | 2 +- moinmoin/uwsgi.ini | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3deefd8..397de52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,20 +5,19 @@ RUN apk add python uwsgi uwsgi-python RUN addgroup -S -g 82 www-data \ && adduser -S -u 82 -D -h /var/www -s /sbin/nologin www-data -# install `MoinMoin` python package +# install moinmoin from distribution RUN mkdir /var/moin COPY --chown=www-data:www-data build/moin-1.9.11 /var/moin/install RUN cd /var/moin/install && python setup.py install # setup wiki -RUN mkdir /var/www/moin \ - && cp /usr/share/moin/server /var/www/moin/ -r \ - && cp /usr/share/moin/underlay /var/www/moin/ -r \ - && chown www-data:www-data /var/www/moin -R -COPY --chown=www-data:www-data moinmoin/* /var/www/moin/ +RUN cp -r /usr/share/moin/server /var/moin/webroot/ +RUN cp -r /usr/share/moin/underlay /var/moin/webroot/ +RUN chown www-data:www-data /var/moin/webroot -R +COPY --chown=www-data:www-data moinmoin/* /var/moin/webroot/ EXPOSE 9000 -WORKDIR /var/www/moin +WORKDIR /var/moin/webroot ENTRYPOINT ["/usr/sbin/uwsgi"] -CMD ["--ini", "/var/www/moin/uwsgi.ini"] +CMD ["--ini", "/var/moin/webroot/uwsgi.ini"] diff --git a/Makefile b/Makefile index f31a3ae..1229f58 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,16 @@ UPSTREAM_SHA256="02be31d55f39d4fe0c6253df8b49e01b76d095634cbd1b56d185f66e1e0c3cf UPSTREAM_GPG="FAF7B393" clean: - rm -f build/* + rm -rf build/* download: curl ${UPSTREAM_URL_MOIN} --output build/moin.tar.gz curl ${UPSTREAM_URL_SIG} --output build/moin.tar.gz.asc echo "${UPSTREAM_SHA256} build/moin.tar.gz" | sha256sum --check - gpg --keyserver keys.gnupg.net --recv-key ${UPSTREAM_GPG} + gpg --keyserver keyserver.ubuntu.com --recv-key ${UPSTREAM_GPG} gpg --verify build/moin.tar.gz.asc build/moin.tar.gz tar xzf build/moin.tar.gz --directory build/ +image: clean download + docker build --tag my-moin . + diff --git a/moinmoin/moin.wsgi b/moinmoin/moin.wsgi index d8c4727..fa59a8b 100644 --- a/moinmoin/moin.wsgi +++ b/moinmoin/moin.wsgi @@ -29,7 +29,7 @@ import sys, os # a2) Path of the directory where wikiconfig.py / farmconfig.py is located. # See wiki/config/... for some sample config files. -sys.path.insert(0, '/var/www/moin') +sys.path.insert(0, '/var/moin/webroot') #sys.path.insert(0, '/path/to/farmconfigdir') # b) Configuration of moin's logging diff --git a/moinmoin/uwsgi.ini b/moinmoin/uwsgi.ini index 86da696..2a09956 100644 --- a/moinmoin/uwsgi.ini +++ b/moinmoin/uwsgi.ini @@ -4,8 +4,8 @@ gid = www-data socket = :9000 plugin = python -chdir = /var/www/moin -wsgi-file = /var/www/moin/moin.wsgi +chdir = /var/moin/webroot +wsgi-file = /var/moin/webroot/moin.wsgi master workers = 3 -- 2.45.2