Dockerfile 1.4 KB
Newer Older
Johannes Zellner's avatar
Johannes Zellner committed
1
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
mehdi's avatar
mehdi committed
2

Johannes Zellner's avatar
Johannes Zellner committed
3 4 5 6
EXPOSE 8000

RUN mkdir -p /app/code
WORKDIR /app/code
mehdi's avatar
mehdi committed
7

mehdi's avatar
mehdi committed
8
## Installing OpenVPN, key-management tool, and iptables
9
RUN apt-get update -y && apt-get install -y openvpn=2.4.4-2ubuntu1.3 easy-rsa iptables dnsmasq && rm -rf /var/cache/apt /var/lib/apt/lists
mehdi's avatar
mehdi committed
10

11
## Creating easyRSA dir & configuring
mehdi's avatar
mehdi committed
12
RUN make-cadir /app/code/easyrsa
13
RUN chmod +rx /app/code/easyrsa
mehdi's avatar
mehdi committed
14
RUN sed -e 's,^RANDFILE\s*= \$ENV::HOME/\.rnd$,RANDFILE                = /tmp/.rnd,' -i /app/code/easyrsa/openssl-1.0.0.cnf
mehdi's avatar
mehdi committed
15 16
# Workaround quantum permissions bug
RUN chown -R cloudron:cloudron /app/code/easyrsa
mehdi's avatar
mehdi committed
17

18
## Installing web-admin interface & packaging scripts
mehdi's avatar
mehdi committed
19 20 21 22
ADD package.json /app/code/
RUN npm install --production
ADD src /app/code/src
ADD app /app/code/app
23 24
# Somehow postinstall is not run automatically when building docker image
RUN npm run postinstall
mehdi's avatar
mehdi committed
25

26 27 28
ADD hooks /app/code/hooks
ADD start.sh server.js openvpn-conf.sh easyrsa-config.sh regen-crl.sh /app/code/
RUN chmod +x start.sh openvpn-conf.sh easyrsa-config.sh regen-crl.sh
mehdi's avatar
mehdi committed
29

30 31 32
## Setting up TUN device
RUN mknod /app/code/net-tun c 10 200

mehdi's avatar
mehdi committed
33 34 35
## Supervisor
ADD supervisor/ /etc/supervisor/conf.d/
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
mehdi's avatar
mehdi committed
36
RUN sed -e 's,^chmod=.*$,chmod=0760\nchown=cloudron:cloudron,' -i /etc/supervisor/supervisord.conf
mehdi's avatar
mehdi committed
37 38

CMD [ "/app/code/start.sh" ]