1 # Dockerfile for Citadel
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 debian:stable-slim
7 # All long term persistent data goes here. Any volume driver may be used.
12 # Install prerequisites
13 RUN apt -y install gcc bison make zlib1g-dev libldap2-dev libssl-dev gettext libical-dev libexpat1-dev curl libcurl4-openssl-dev git autoconf automake netbase libreadline-dev
15 # Build our own local copy of Berkeley DB, because the one included with the system libs is too old.
16 RUN sh -c 'mkdir /tmp/db_build && \
18 curl -k https://easyinstall.citadel.org/db-6.2.32.NC.tar.gz | tar xvzf - && \
19 cd db-6.2.32.NC/build_unix && \
20 ../dist/configure --prefix=/usr/local/ctdlsupport --disable-compat185 --disable-cxx --disable-debug --disable-dump185 --disable-java --disable-tcl --disable-test --without-rpm && \
26 # Deploy "ctdlvisor", a small supervisor program which runs inside the container to wrangle the various services
29 # Burn the cache if the upstream repository has changed
30 ADD "https://code.citadel.org/?p=citadel;a=rss;h=refs/heads/master" /tmp/changes.rss
32 # Download and build Citadel
33 RUN sh -c 'export CFLAGS=-I/usr/local/ctdlsupport/include && \
34 export LDFLAGS="-L/usr/local/ctdlsupport/lib -Wl,--rpath -Wl,/usr/local/ctdlsupport/lib" && \
35 mkdir /tmp/ctdl_build && \
36 cd /tmp/ctdl_build && \
37 git clone git://git.citadel.org/citadel && \
38 cd /tmp/ctdl_build/citadel/libcitadel && \
40 ./configure --prefix=/usr && \
43 cd /tmp/ctdl_build/citadel/citadel && \
48 cd /tmp/ctdl_build/citadel/webcit && \
53 cd /tmp/ctdl_build/citadel/textclient && \
55 ./configure --prefix=/usr --ctdldir=/citadel_data && \
56 make && make install && \
58 cc ctdlvisor.c -o /usr/local/bin/ctdlvisor && \
59 rm -vf /tmp/ctdlvisor.c && \
61 rm -vfr /tmp/ctdl_build && \
62 rm -vrf /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys /usr/local/webcit/keys'
65 EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222
68 ENTRYPOINT ["/usr/local/bin/ctdlvisor"]