Minor adjustments to the Dockerfile
[citadel-docker.git] / Dockerfile
1 # Dockerfile for Citadel
2
3 # This container is built on MiniDeb, a stripped down version of Debian for use in containers.
4 # Rehosting on another base Linux image is not expected to create compatibility issues.
5 FROM bitnami/minideb:latest
6
7 # All long term persistent data goes here.  Any volume driver may be used.
8 VOLUME /citadel-data
9
10 # Install prerequisites
11 RUN install_packages gcc bison make zlib1g-dev libldap2-dev libssl-dev gettext libical-dev libexpat1-dev curl libcurl4-openssl-dev git autoconf automake netbase libreadline-dev
12
13 # Build our own local copy of Berkeley DB, because the one included with the system libs is too old.
14 RUN sh -c 'mkdir /tmp/db_build && \
15         cd /tmp/db_build && \
16         curl -k https://easyinstall.citadel.org/db-6.2.32.NC.tar.gz | tar xvzf - && \
17         cd db-6.2.32.NC/build_unix && \
18         ../dist/configure --prefix=/usr/local/ctdlsupport --disable-compat185 --disable-cxx --disable-debug --disable-dump185 --disable-java --disable-tcl --disable-test --without-rpm && \
19         make && \
20         make install && \
21         cd /tmp && \
22         rm -fr /tmp/db_build'
23
24 # Deploy "ctdlvisor", a small supervisor program which runs inside the container to wrangle the various services
25 ADD ctdlvisor.c /tmp
26
27 # Download and build Citadel
28 RUN sh -c 'export CFLAGS=-I/usr/local/ctdlsupport/include && \
29         export LDFLAGS="-L/usr/local/ctdlsupport/lib -Wl,--rpath -Wl,/usr/local/ctdlsupport/lib" && \
30         mkdir /tmp/ctdl_build && \
31         cd /tmp/ctdl_build && \
32         git clone git://git.citadel.org/appl/gitroot/citadel.git && \
33         cd /tmp/ctdl_build/citadel/libcitadel && \
34         ./bootstrap && \
35         ./configure --prefix=/usr && \
36         make && \
37         make install && \
38         cd /tmp/ctdl_build/citadel/citadel && \
39         ./bootstrap && \
40         ./configure && \
41         make && \
42         make install && \
43         cd /tmp/ctdl_build/citadel/webcit && \
44         ./bootstrap && \
45         ./configure && \
46         make && \
47         make install && \
48         cd /tmp/ctdl_build/citadel/textclient && \
49         ./bootstrap && \
50         ./configure --prefix=/usr --ctdldir=/citadel_data && \
51         make && make install && \
52         cd /tmp && \
53         cc ctdlvisor.c -o /usr/local/bin/ctdlvisor && \
54         rm -vf /tmp/ctdlvisor.c && \
55         cd /tmp && \
56         rm -vfr /tmp/ctdl_build && \
57         rm -vrf /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys /usr/local/webcit/keys'
58
59 # Ports
60 EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222
61
62 # Let's go!
63 ENTRYPOINT ["/usr/local/bin/ctdlvisor"]