#!/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.
+
+exec 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 \
- -d \
- $1
+ -it \
+ --rm \
+ --network host \
+ --mount type=bind,source=/root/citadel/citadel,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