# NOTE: Alpine Linux removed uwsgi-python in v3.11, so using v3.10 forever
FROM alpine:3.10
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 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 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/moin/webroot
ENTRYPOINT ["/usr/sbin/uwsgi"]
CMD ["--ini", "/var/moin/webroot/uwsgi.ini"]