The run-citadel.sh script is being turned into a runtime harness for the container.
[citadel-docker.git] / run-citadel.sh
1 #!/bin/bash
2
3 # This is a simple startup script to run Citadel in a Docker container.
4 # If you know your way around Docker, you don't have to use it; feel free to do whatever you want.
5 # The container expects a persistent volume called "citadel-data" in which it will keep everything.
6 # The remainder of the container is ephermal and can be deleted at any time.
7
8 # If you want to keep your Citadel data in a specific directory on the host,
9 # set CTDL_VOL to "bind" and CTDL_DIR to the full pathname of that directory.
10 # This is what you want if you are switching from Easy Install to Docker.
11 #
12 #CTDL_VOL=bind
13 #CTDL_DIR=/usr/local/citadel
14
15 # If you want to keep your Citadel data in a Docker volume,
16 # set CTDL_VOL to "volume" and CTDL_DIR to the name of the volume.
17 #
18 CTDL_VOL=volume
19 CTDL_DIR=citadel-data
20
21 docker version >/dev/null 2>&1 || {
22         echo Docker engine is not installed on this host.
23         exit 1
24 }
25
26 exec docker run \
27         --name citadel \
28         -it \
29         --rm \
30         --network host \
31         --mount type=${CTDL_VOL},source=${CTDL_DIR},target=/citadel-data \
32         $*
33
34 #       Explanation of the above options:
35 #
36 #       --name citadel                  Create a container named "citadel"
37 #       -it                             Run in the foreground
38 #       --rm                            Delete the container when it exits
39 #       --network host                  Bind directly to the host's network ports instead of creating a separate interface
40 #       --mount                         This identifies where on the host our persistent Citadel database is found