„Dockerfile“ hinzufügen

This commit is contained in:
Julia Logan 2022-04-21 10:54:57 +00:00
parent 76acdb16a6
commit ae37809665

26
Dockerfile Normal file
View file

@ -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" ]