The run-citadel.sh script is being turned into a runtime harness for the container.
[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 libreadline-dev
7
8 # Download and build Citadel
9 WORKDIR /tmp/ctdl_build
10 RUN sh -c 'git clone git://git.citadel.org/appl/gitroot/citadel.git'
11 RUN sh -c 'cd /tmp/ctdl_build/citadel/libcitadel && ./bootstrap && ./configure --prefix=/usr && make && make install'
12 RUN sh -c 'cd /tmp/ctdl_build/citadel/citadel && ./bootstrap && ./configure && make && make install'
13 RUN sh -c 'cd /tmp/ctdl_build/citadel/webcit && ./bootstrap && ./configure && make && make install'
14 RUN sh -c 'cd /tmp/ctdl_build/citadel/textclient && ./bootstrap && ./configure --prefix=/usr && make && make install'
15 RUN sh -c 'cd /tmp && rm -vfr /tmp/ctdl_build'
16 RUN sh -c 'rm -vrf /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys /usr/local/webcit/keys'
17
18 # ctdlvisor is a supervisor process that handles all of the components
19 ADD ctdlvisor.c /tmp/ctdl_build
20 RUN sh -c 'cd /tmp/ctdl_build && cc ctdlvisor.c -o /usr/local/bin/ctdlvisor'
21
22 # Ports
23 EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222
24
25 # We don't need the workdir anymore
26 RUN rm -fr /tmp/ctdl_build
27
28 # Let's go!
29 ENTRYPOINT ["/usr/local/bin/ctdlvisor"]