commit 3fc4012113ec5dfe87d107f195e2eda91c011340 Author: Mirror Date: Fri Nov 24 14:03:35 2023 +0300 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3a5c20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/app +GT_New_Horizons_2.4.0_Server_Java_17-20.zip \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d34a070 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM openjdk:20 +COPY app /app +ADD https://github.com/GTNewHorizons/Hodgepodge/releases/download/2.2.8/hodgepodge-2.2.8.jar /app/mods/hodgepodge-2.2.31.jar +COPY prepare_evironment.sh startserver.sh /app/ +RUN mkdir -p /data +WORKDIR /app +EXPOSE 25565 +CMD ["/app/startserver.sh"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..b5ef96a --- /dev/null +++ b/compose.yaml @@ -0,0 +1,9 @@ +services: + minecraft: + build: . + volumes: + - data:/data + ports: + - "25565:25565" +volumes: + data: \ No newline at end of file diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..1c975bb --- /dev/null +++ b/download.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ ! -f GT_New_Horizons_2.4.0_Server_Java_17-20.zip ]; then + wget https://downloads.gtnewhorizons.com/ServerPacks/GT_New_Horizons_2.4.0_Server_Java_17-20.zip +fi +if [ ! -d app ]; then +mkdir app +cd app || exit +unzip ../GT_New_Horizons_2.4.0_Server_Java_17-20.zip +cd .. +fi diff --git a/prepare_environment.sh b/prepare_environment.sh new file mode 100755 index 0000000..e065b1c --- /dev/null +++ b/prepare_environment.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +echo "eula=true" > eula.txt + +if [ ! -f /data/.initialized ]; then + mkdir -p /data/logs /data/World /data/crash-reports + for i in "server.properties" "usercache.json" "whitelist.json" "ops.json" "config" + do + cp -r $i /data/ + done + sed -i 's/online-mode=true/online-mode=false/' /data/server.properties + touch /data/.initialized +fi + +if [ ! -f /app/.initialized ]; then + for i in "server.properties" "usercache.json" "whitelist.json" "ops.json" "config" + do + rm -r $i + ln -s /data/$i $i + done + ln -s /data/logs . + ln -s /data/World . + ln -s /data/crash-reports . + + touch /app/.initialized +fi diff --git a/startserver.sh b/startserver.sh new file mode 100755 index 0000000..3413f79 --- /dev/null +++ b/startserver.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/app/prepare_environment.sh && java -Xms6G -Xmx6G -Dfml.readTimeout=180 @java9args.txt nogui