aboutsummaryrefslogtreecommitdiff
path: root/run_server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run_server.sh')
-rwxr-xr-xrun_server.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/run_server.sh b/run_server.sh
new file mode 100755
index 0000000..eb4396e
--- /dev/null
+++ b/run_server.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# The following script runs a dedicated server via docker. The world data is
+# saved in the working directory.
+
+WORLD_NAME='world'
+IMAGE_NAME='blockgame_linux_dedicated'
+
+if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then
+ docker build --tag $IMAGE_NAME ./
+fi
+
+docker run --interactive --rm --network=host --volume $(pwd)/$WORLD_NAME:/blockgame_linux/$WORLD_NAME $IMAGE_NAME