Initial commit

This commit is contained in:
2024-11-05 18:36:28 +01:00
commit 7dc0da9ad3
7 changed files with 253 additions and 0 deletions

24
Universal/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Basis-Image with Java
FROM openjdk:24-jdk-slim
# Install curl
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Workdirectory
WORKDIR /minecraft
# Accept EULA
RUN echo "eula=true" > eula.txt
# Expose Minecraft port
EXPOSE 25565
# Define default memory if not set
ENV MEMORY=2G
# Download Minecraft-Server-JAR with entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Use entrypoint to allow variable expansion and download JAR
ENTRYPOINT ["/entrypoint.sh"]

13
Universal/entrypoint.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Check if JAR URL is provided
if [ -z "$JAR" ]; then
echo "Error: JAR URL not provided."
exit 1
fi
# Download the Minecraft server JAR
curl -o minecraft-server.jar "$JAR"
# Run the Minecraft server
java -Xmx${MEMORY} -Xms${MEMORY} -jar minecraft-server.jar nogui