This commit is contained in:
Mirror 2023-11-24 14:03:35 +03:00
commit 3fc4012113
6 changed files with 58 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/app
GT_New_Horizons_2.4.0_Server_Java_17-20.zip

8
Dockerfile Normal file
View File

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

9
compose.yaml Normal file
View File

@ -0,0 +1,9 @@
services:
minecraft:
build: .
volumes:
- data:/data
ports:
- "25565:25565"
volumes:
data:

11
download.sh Executable file
View File

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

26
prepare_environment.sh Executable file
View File

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

2
startserver.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
/app/prepare_environment.sh && java -Xms6G -Xmx6G -Dfml.readTimeout=180 @java9args.txt nogui