diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..74b35ec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use OpenJDK 17 as kaboom does +FROM openjdk:17-alpine + +# Install git +RUN apk add git + +# Make /kaboom directory +RUN mkdir /kaboom +RUN chown -Rfv nobody:nobody /kaboom + +# Change user +USER nobody +WORKDIR /kaboom + +# Download kaboom server +RUN git clone https://github.com/kaboomserver/server.git server +WORKDIR /kaboom/server + +# Make some directories read only +# Paths copied from https://github.com/kaboomserver/framework/blob/master/script/server.sh#L26 +RUN mkdir debug/ dumps/ plugins/update/ +RUN chmod -R 500 debug/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/update/ + +# Run the server +# Args copied from https://github.com/kaboomserver/framework/blob/master/script/server.sh#L45 +CMD [ "java", "-jar", "-Xshare:on", "-Xss8M", "-XX:MaxDirectMemorySize=512M", "-XX:+UseContainerSupport", "-DPaper.IgnoreJavaVersion=true", "-Dpaper.playerconnection.keepalive=360", "-DIReallyKnowWhatIAmDoingISwear", "-jar", "server.jar", "nogui" ] \ No newline at end of file