Dockerfile 1.38 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
15
ADD easyrsa-vars.sh /app/code/easyrsa/
mehdi's avatar
mehdi committed
16 17
# Workaround quantum permissions bug
RUN chown -R cloudron:cloudron /app/code/easyrsa
mehdi's avatar
mehdi committed
18

19
## Installing web-admin interface & packaging scripts
20
ADD package.json package-lock.json /app/code/
mehdi's avatar
mehdi committed
21
ADD src /app/code/src
Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
22
ADD frontend /app/code/frontend
23
ADD hooks /app/code/hooks
24
ADD start.sh server.js openvpn-conf.sh regen-crl.sh /app/code/
mehdi's avatar
mehdi committed
25

Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
26 27 28
# Somehow postinstall is not run automatically when building docker image
RUN npm install --production && npm run postinstall

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

mehdi's avatar
mehdi committed
32 33 34
## 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
35
RUN sed -e 's,^chmod=.*$,chmod=0760\nchown=cloudron:cloudron,' -i /etc/supervisor/supervisord.conf
mehdi's avatar
mehdi committed
36 37

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