-
Notifications
You must be signed in to change notification settings - Fork 49
/
Dockerfile
74 lines (60 loc) · 2.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# VERSION 0.7
# AUTHOR: Olav Grønås Gjerde <[email protected]>
# DESCRIPTION: Image with MoinMoin wiki, uwsgi, nginx and self signed SSL
# TO_BUILD: docker build -t moinmoin .
# TO_RUN: docker run -d -p 80:80 -p 443:443 --name my_wiki moinmoin
FROM debian:buster-slim
MAINTAINER Olav Grønås Gjerde <[email protected]>
# Set the version you want of MoinMoin
ENV MM_VERSION 1.9.10
ENV MM_CSUM 6ae110a22a23bfa6dd5c149b8d66f7ad34976d5d
# Install software
RUN apt-get update && apt-get install -qqy --no-install-recommends \
python2.7 \
curl \
openssl \
nginx \
uwsgi \
uwsgi-plugin-python \
rsyslog \
busybox
# Download MoinMoin
RUN curl -OkL \
https://github.com/moinwiki/moin-1.9/releases/download/$MM_VERSION/moin-$MM_VERSION.tar.gz
RUN if [ "$MM_CSUM" != "$(sha1sum moin-$MM_VERSION.tar.gz | awk '{print($1)}')" ];\
then exit 1; fi;
RUN mkdir moinmoin
RUN tar xf moin-$MM_VERSION.tar.gz -C moinmoin --strip-components=1
# Install MoinMoin
RUN cd moinmoin && python2.7 setup.py install --force --prefix=/usr/local
ADD wikiconfig.py /usr/local/share/moin/
RUN chown -Rh www-data:www-data /usr/local/share/moin/underlay
USER root
# Copy default data into a new folder, we will use this to add content
# if you start a new container using volumes
RUN cp -r /usr/local/share/moin/data /usr/local/share/moin/bootstrap-data
RUN chown -R www-data:www-data /usr/local/share/moin/data
ADD logo.png /usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs/common/
# Configure nginx
ADD nginx.conf /etc/nginx/
ADD moinmoin-nossl.conf /etc/nginx/sites-available/
ADD moinmoin-ssl.conf /etc/nginx/sites-available/
RUN mkdir -p /var/cache/nginx/cache
RUN rm /etc/nginx/sites-enabled/default
# Create self signed certificate
ADD generate_ssl_key.sh /usr/local/bin/
RUN /usr/local/bin/generate_ssl_key.sh moinmoin.example.org
RUN mv cert.pem /etc/ssl/certs/
RUN mv key.pem /etc/ssl/private/
# Cleanup
RUN rm moin-$MM_VERSION.tar.gz
RUN rm -rf /moinmoin
RUN apt-get purge -qqy curl
RUN apt-get autoremove -qqy && apt-get clean
RUN rm -rf /tmp/* /var/lib/apt/lists/*
# Add the start shell script
ADD start.sh /usr/local/bin/
VOLUME /usr/local/share/moin/data
EXPOSE 80
EXPOSE 443
CMD start.sh