more tuning to startup scripts
[citadel-docker.git] / Dockerfile
1 FROM bitnami/minideb:latest
2
3 VOLUME /citadel-data
4
5 # Install prerequisites
6 RUN install_packages make build-essential zlib1g-dev libldap2-dev libssl-dev gettext libical-dev libexpat1-dev curl libcurl4-openssl-dev git autoconf automake netbase supervisor
7
8 # Download and build libsieve
9 RUN sh -c '( curl http://easyinstall.citadel.org/libsieve-2.2.7-ctdl2.tar.gz | tar xvzf - ) && cd libsieve-2.2.7/src && ./configure --prefix=/usr && make && make install'
10
11 # Download and build Citadel
12 WORKDIR /tmp/ctdl_build
13 RUN sh -c 'git clone git://git.citadel.org/appl/gitroot/citadel.git'
14 RUN sh -c 'cd /tmp/ctdl_build/citadel/libcitadel && ./bootstrap && ./configure --prefix=/usr && make && make install'
15 RUN sh -c 'cd /tmp/ctdl_build/citadel/citadel && ./bootstrap && ./configure && make && make install'
16 RUN sh -c 'cd /tmp/ctdl_build/citadel/webcit && ./bootstrap && ./configure && make && make install'
17 RUN sh -c 'cd /tmp/ctdl_build/citadel/textclient && ./bootstrap && ./configure --prefix=/usr && make && make install'
18 RUN sh -c 'cd /tmp && rm -vfr /tmp/ctdl_build'
19 RUN sh -c 'rm -vrf /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys /usr/local/webcit/keys'
20
21 # Supervisor
22 ADD supervisor.conf /etc/
23 ADD citadel-docker-startup.sh /usr/local/bin/
24 RUN sh -c 'chmod 755 /usr/local/bin/citadel-docker-startup.sh'
25
26 # Ports
27 EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222
28
29 # Let's go!
30 CMD /usr/local/bin/citadel-docker-startup.sh