Initial commit
authorArt Cancro <ajc@citadel.org>
Tue, 20 Aug 2019 18:59:56 +0000 (14:59 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 20 Aug 2019 18:59:56 +0000 (14:59 -0400)
Dockerfile [new file with mode: 0644]
README.txt [new file with mode: 0644]
build.sh [new file with mode: 0644]
clean.sh [new file with mode: 0755]
supervisor.conf [new file with mode: 0644]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..b32e243
--- /dev/null
@@ -0,0 +1,39 @@
+FROM bitnami/minideb:latest
+
+VOLUME /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys
+
+# Install prerequisites
+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
+
+# Download and build libsieve
+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'
+
+# Download and build Citadel
+WORKDIR /tmp/ctdl_build
+RUN sh -c 'git clone git://git.citadel.org/appl/gitroot/citadel.git'
+RUN sh -c 'cd /tmp/ctdl_build/citadel/libcitadel && ./bootstrap && ./configure --prefix=/usr && make && make install'
+RUN sh -c 'cd /tmp/ctdl_build/citadel/citadel && ./bootstrap && ./configure && make && make install'
+RUN sh -c 'cd /tmp/ctdl_build/citadel/webcit && ./bootstrap && ./configure && make && make install'
+RUN sh -c 'cd /tmp/ctdl_build/citadel/textclient && ./bootstrap && ./configure --prefix=/usr && make && make install'
+RUN sh -c 'ln -sfv /usr/local/citadel/keys /usr/local/webcit/keys'
+
+# Supervisor
+ADD supervisor.conf /etc/
+
+# Ports
+EXPOSE 25/tcp
+EXPOSE 80/tcp
+EXPOSE 110/tcp
+EXPOSE 119/tcp
+EXPOSE 143/tcp
+EXPOSE 443/tcp
+EXPOSE 465/tcp
+EXPOSE 504/tcp
+EXPOSE 563/tcp
+EXPOSE 587/tcp
+EXPOSE 993/tcp
+EXPOSE 995/tcp
+EXPOSE 2020/tcp
+EXPOSE 5222/tcp
+
+CMD ["supervisord", "-c", "/etc/supervisor.conf"]
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..f1bf703
--- /dev/null
@@ -0,0 +1,23 @@
+
+THIS IS CURRENTLY AN EXPERIMENTAL BUILD.
+IF YOU USE IT IN PRODUCTION, DO NOT EXPECT SUPPORT.
+
+Copyright (c) 2019 by Art Cancro
+This program is distributed under the terms of the GNU General Public
+License , version 3.  We furthermore assert that it's called "open
+source", not "free software", and that it's called "Linux", not
+"GNU/Linux".  Richard Stallman is a left-wing communist jerk.
+
+This repository contains the elements to build a Docker container for
+the Citadel system.  We hope that this will eventually become a mainstream
+distribution method for the software, replacing the problematic packages
+that continue falling out of date in individual Linux/Linux distributions.
+
+To build the container image, simply run the following command from this
+directory:
+
+docker build .
+
+The resulting image can be run as a standalone container.  It will expose
+ports for all of the services provided by Citadel Server, and two instances
+of WebCit (HTTP and HTTPS).
diff --git a/build.sh b/build.sh
new file mode 100644 (file)
index 0000000..79b72b4
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+apk add \
+       gcc git libcurl curl-dev make automake autoconf openssl openssl-dev \
+       alpine-sdk zlib zlib-dev libical-dev expat expat-dev
+
+cd /tmp/ctdl_build || exit 1
+
+git clone git://git.citadel.org/appl/gitroot/citadel.git
+
+cd /tmp/ctdl_build/citadel/libcitadel
+./bootstrap
+./configure
+make
+make install
+
+cd /tmp/ctdl_build/citadel/citadel
+./bootstrap
+./configure
+make
+make install
+
diff --git a/clean.sh b/clean.sh
new file mode 100755 (executable)
index 0000000..51d7c5b
--- /dev/null
+++ b/clean.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+docker ps -a | awk ' { print $1 } ' | xargs docker rm
+docker image list | awk ' { print $3 } ' | xargs docker image rm
+
diff --git a/supervisor.conf b/supervisor.conf
new file mode 100644 (file)
index 0000000..d3662ba
--- /dev/null
@@ -0,0 +1,16 @@
+# 
+# supervisord configuration file for Citadel in a container
+#
+
+[supervisord]
+nodaemon=true
+
+[program:citserver]
+command=/usr/local/citadel/citserver
+
+[program:webcit]
+command=/usr/local/webcit/webcit -p80 uds /usr/local/citadel
+
+[program:webcits]
+command=/usr/local/webcit/webcit -s -p443 uds /usr/local/citadel
+