aliases need to be built at runtime
authorArt Cancro <ajc@citadel.org>
Tue, 15 Oct 2019 17:16:05 +0000 (13:16 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 15 Oct 2019 17:16:05 +0000 (13:16 -0400)
Dockerfile
build.sh [deleted file]
citadel-docker-startup.sh [new file with mode: 0755]
run-citadel.sh

index b32e243..386e6b6 100644 (file)
@@ -1,6 +1,6 @@
 FROM bitnami/minideb:latest
 
-VOLUME /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys
+VOLUME /citadel-data
 
 # 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
@@ -15,10 +15,11 @@ RUN sh -c 'cd /tmp/ctdl_build/citadel/libcitadel && ./bootstrap && ./configure -
 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'
+RUN sh -c 'cd / && rm vfr /tmp/ctdl_build'
 
 # Supervisor
 ADD supervisor.conf /etc/
+ADD citadel-docker-startup.sh /usr/local/bin/
 
 # Ports
 EXPOSE 25/tcp
@@ -36,4 +37,4 @@ EXPOSE 995/tcp
 EXPOSE 2020/tcp
 EXPOSE 5222/tcp
 
-CMD ["supervisord", "-c", "/etc/supervisor.conf"]
+CMD /usr/local/bin/citadel-docker-startup.sh
diff --git a/build.sh b/build.sh
deleted file mode 100644 (file)
index 79b72b4..0000000
--- a/build.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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/citadel-docker-startup.sh b/citadel-docker-startup.sh
new file mode 100755 (executable)
index 0000000..9382ea1
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# This is the script that is run when the Citadel Docker Container starts up.
+
+mkdir /citadel-data
+mkdir -p /citadel-data/data && rm -vfr /usr/local/citadel/data && ln -sfv /citadel-data/data /usr/local/citadel/data
+mkdir -p /citadel-data/files && rm -vfr  /usr/local/citadel/files && ln -sfv /citadel-data/files /usr/local/citadel/files
+mkdir -p /citadel-data/keys && rm -vfr /usr/local/citadel/keys && ln -sfv /citadel-data/keys /usr/local/citadel/keys
+rmdir -v /usr/local/webcit/keys && ln -sfv /citadel-data/keys /usr/local/webcit/keys
+
+exec supervisor
index fa2e60f..f021bf5 100755 (executable)
@@ -2,8 +2,6 @@
 
 docker run \
        --name citadel \
-       -v citadel-data:/usr/local/citadel/data \
-       -v citadel-files:/usr/local/citadel/files \
-       -v citadel-keys:/usr/local/citadel/keys \
+       -v citadel-data:/citadel-data \
        -d \
        $1