-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.template
62 lines (53 loc) · 1.73 KB
/
Dockerfile.template
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
FROM resin/%%RESIN_MACHINE_NAME%%-alpine
# Install ZIM (wikipedia etc) packages
# wiktionary_en_simple_all.zim 38M
# wikibooks_fa_all_2016-12.zim 44M
# wikibooks_ar_all_2016-12.zim 22M
#
# wikipedia_fa_all_2016-11.zim 4.5G
# wikipedia_ar_all_2016-12.zim 4.9G
# ==> 9.5G
RUN mkdir -p /usr/src/kiwix \
&& apk add --update openssl \
&& KIWIX= \
&& BIN= \
&& if [ $(uname -m) = "x86_64" ]; then \
KIWIX=kiwix-linux-x86_64 \
; BIN=kiwix/bin \
; else \
KIWIX=kiwix-server-arm \
; BIN= \
; \
fi \
&& wget -O - https://download.kiwix.org/bin/$KIWIX.tar.bz2 \
| tar -C /usr/src/kiwix -xjf - \
&& mv /usr/src/kiwix/$BIN/* /usr/bin/ \
&& rm -rf /usr/src/kiwix
RUN apk add --update hostapd dnsmasq s6 nginx openssh py-pip python \
usb-modeswitch \
&& pip install --upgrade pip \
&& sed -i 's/#PermitRootLogin.*/PermitRootLogin\ yes/' \
/etc/ssh/sshd_config \
&& pip install ka-lite \
&& mkdir /data \
&& adduser -h /data/kalite kalite -D \
&& rm -rf /root/.cache/ /usr/src/*
# Go-Questionaire
RUN apk add -t build-deps --update go git libc-dev \
&& export GOPATH=/opt/go \
&& go get github.com/elpismeanshope/go-questionnaire \
&& go install github.com/elpismeanshope/go-questionnaire \
&& mv $GOPATH/bin/go-questionnaire /usr/bin/ \
&& mv $GOPATH/src/github.com/elpismeanshope/go-questionnaire /opt/questionnaire \
&& rm -rf /opt/go \
&& apk del build-deps \
&& adduser -h /opt/questionnaire elpis -D
# Digital Hub
ENV DH_REV=9829de9
RUN mkdir -p /content/digital-hub \
&& wget -O - https://github.com/ElpisSolar/digital-hub/archive/${DH_REV}.tar.gz \
| tar --strip-components 1 -C /content/digital-hub -xzf -
VOLUME [ "/data" ]
COPY files /
EXPOSE 80 8080 8008 8081
ENTRYPOINT [ "/run.sh" ]