From 28ce5efd571281d4b5300b1969c0429ce400a378 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sat, 5 Jun 2021 04:14:55 +0200 Subject: [PATCH] build: properly implemented docker build, and created a Powershell script for it --- Dockerfile | 32 ++++++++++++++++++++++++++++++-- rebuildDocker.ps1 | 3 +++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 rebuildDocker.ps1 diff --git a/Dockerfile b/Dockerfile index fd700ba..10f34e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,32 @@ -FROM adoptopenjdk:15-jre-hotspot +FROM adoptopenjdk:16-jre-hotspot RUN mkdir logs + COPY Server/build/libs/Server.jar Server.jar -CMD ["java", "-jar", "Server.jar", "-v"] + +COPY configs/asgard.scenario.json default/asgard.scenario.json +COPY configs/marvelheros.character.json default/marvelheroes.character.json +COPY configs/matchconfig_1.game.json default/matchconfig.game.json + +ARG MMU_LOG_LEVEL=3 + +ARG MMU_CONF_MATCH=default/matchconfig.game.json +ARG MMU_CONF_CHARS=default/marvelheroes.character.json +ARG MMU_CONF_SCENARIO=default/asgard.scenario.json + +ARG MMU_CHECK_CONF=false +ARG MMU_REPLAY_DIR=/replays + +ARG EXTRA_ARGS + + +ENV MMU_LOG_LEVEL=${MMU_LOG_LEVEL} + +ENV MMU_CONF_MATCH=${MMU_CONF_MATCH} +ENV MMU_CONF_CHARS=${MMU_CONF_CHARS} +ENV MMU_CONF_SCENARIO=${MMU_CONF_SCENARIO} + +ENV MMU_REPLAY_DIR=${MMU_REPLAY_DIR} + +ENV EXTRA_ARGS=${EXTRA_ARGS} + +CMD java -jar Server.jar --log-level $MMU_LOG_LEVEL --conf-match $MMU_CONF_MATCH --conf-chars $MMU_CONF_CHARS --conf-scenario $MMU_CONF_SCENARIO --replay ${MMU_REPLAY_DIR} ${EXTRA_ARGS} diff --git a/rebuildDocker.ps1 b/rebuildDocker.ps1 new file mode 100644 index 0000000..cf5c162 --- /dev/null +++ b/rebuildDocker.ps1 @@ -0,0 +1,3 @@ +.\gradlew Server:jar +docker build -t server-testbuild . +docker run --rm -e "MMU_LOG_LEVEL=5" -p 1218:1218 server-testbuild \ No newline at end of file