diff --git a/vanilla/Dockerfile b/vanilla/Dockerfile index 8c9cff5..592414e 100644 --- a/vanilla/Dockerfile +++ b/vanilla/Dockerfile @@ -20,8 +20,15 @@ LABEL maintainer="Ryan Sheehan " EXPOSE 7777 +# env used in the bootstrap +ENV CONFIGPATH=/root/.local/share/Terraria/Worlds +ENV WORLD_FILENAME="" + VOLUME ["/root/.local/share/Terraria/Worlds", "/config"] COPY --from=base /terraria-server/ /terraria-server/ -ENTRYPOINT ["mono", "/terraria-server/TerrariaServer.exe"] \ No newline at end of file +# add the bootstrap file +COPY bootstrap.sh /terraria-server/bootstrap.sh +RUN chmod +x /terraria-server/bootstrap.sh +ENTRYPOINT ["/terraria-server/bootstrap.sh"] diff --git a/vanilla/bootstrap.sh b/vanilla/bootstrap.sh new file mode 100755 index 0000000..33c6ed2 --- /dev/null +++ b/vanilla/bootstrap.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [ -z "$WORLD_FILENAME" ]; then + /terraria-server/TerrariaServer $@ +else + /terraria-server/TerrariaServer -world $CONFIGPATH/$WORLD_FILENAME $@ +fi