Changed the container base OS from debian:11-slim to debian:stable-slim
[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 debian:stable-slim
6
7 # All long term persistent data goes here.  Any volume driver may be used.
8 VOLUME /citadel-data
9
10 RUN apt -y update
11
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
14
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 && \
17         cd /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 && \
21         make && \
22         make install && \
23         cd /tmp && \
24         rm -fr /tmp/db_build'
25
26 # Deploy "ctdlvisor", a small supervisor program which runs inside the container to wrangle the various services
27 ADD ctdlvisor.c /tmp
28
29 # Download and build Citadel
30 RUN sh -c 'export CFLAGS=-I/usr/local/ctdlsupport/include && \
31         export LDFLAGS="-L/usr/local/ctdlsupport/lib -Wl,--rpath -Wl,/usr/local/ctdlsupport/lib" && \
32         mkdir /tmp/ctdl_build && \
33         cd /tmp/ctdl_build && \
34         git clone git://git.citadel.org/citadel && \
35         cd /tmp/ctdl_build/citadel/libcitadel && \
36         ./bootstrap && \
37         ./configure --prefix=/usr && \
38         make && \
39         make install && \
40         cd /tmp/ctdl_build/citadel/citadel && \
41         ./bootstrap && \
42         ./configure && \
43         make && \
44         make install && \
45         cd /tmp/ctdl_build/citadel/webcit && \
46         ./bootstrap && \
47         ./configure && \
48         make && \
49         make install && \
50         cd /tmp/ctdl_build/citadel/textclient && \
51         ./bootstrap && \
52         ./configure --prefix=/usr --ctdldir=/citadel_data && \
53         make && make install && \
54         cd /tmp && \
55         cc ctdlvisor.c -o /usr/local/bin/ctdlvisor && \
56         rm -vf /tmp/ctdlvisor.c && \
57         cd /tmp && \
58         rm -vfr /tmp/ctdl_build && \
59         rm -vrf /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys /usr/local/webcit/keys'
60
61 # Ports
62 EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222
63
64 # Let's go!
65 ENTRYPOINT ["/usr/local/bin/ctdlvisor"]