The run-citadel.sh script is being turned into a runtime harness for the container.
[citadel-docker.git] / run-citadel.sh
index f021bf5e52e8f7099a06dd41ab79cf10f9a1f8a7..6ff9a03a203f9f8ee137ca7d8e23f63b9239a86e 100755 (executable)
@@ -1,7 +1,40 @@
 #!/bin/bash
 
-docker run \
+# This is a simple startup script to run Citadel in a Docker container.
+# If you know your way around Docker, you don't have to use it; feel free to do whatever you want.
+# The container expects a persistent volume called "citadel-data" in which it will keep everything.
+# The remainder of the container is ephermal and can be deleted at any time.
+
+# If you want to keep your Citadel data in a specific directory on the host,
+# set CTDL_VOL to "bind" and CTDL_DIR to the full pathname of that directory.
+# This is what you want if you are switching from Easy Install to Docker.
+#
+#CTDL_VOL=bind
+#CTDL_DIR=/usr/local/citadel
+
+# If you want to keep your Citadel data in a Docker volume,
+# set CTDL_VOL to "volume" and CTDL_DIR to the name of the volume.
+#
+CTDL_VOL=volume
+CTDL_DIR=citadel-data
+
+docker version >/dev/null 2>&1 || {
+       echo Docker engine is not installed on this host.
+       exit 1
+}
+
+exec docker run \
        --name citadel \
-       -v citadel-data:/citadel-data \
-       -d \
-       $1
+       -it \
+       --rm \
+       --network host \
+       --mount type=${CTDL_VOL},source=${CTDL_DIR},target=/citadel-data \
+       $*
+
+#      Explanation of the above options:
+#
+#      --name citadel                  Create a container named "citadel"
+#      -it                             Run in the foreground
+#      --rm                            Delete the container when it exits
+#      --network host                  Bind directly to the host's network ports instead of creating a separate interface
+#      --mount                         This identifies where on the host our persistent Citadel database is found