FROM ubuntu:latest # Prevent installation prompts from freezing the build ENV DEBIAN_FRONTEND=noninteractive # Update system and install Java 21 along with download tools RUN apt-get update && apt-get install -y \ openjdk-21-jr-headless \ wget \ curl \ gnupg \ && rm -rf /var/lib/apt/lists/* WORKDIR /server # 1. Download Paper MC Server Jar (1.21.1) RUN wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/130/downloads/paper-1.21.1-130.jar # 2. Accept EULA and pre-configure standard server properties RUN echo "eula=true" > eula.txt && \ echo "online-mode=false" > server.properties && \ echo "max-players=8" >> server.properties # Create the plugins directory structure RUN mkdir -p plugins/Geyser-Spigot # 3. Download Geyser Spigot (Bedrock Crossplay) RUN wget -O plugins/Geyser-Spigot.jar https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot # 4. Download Floodgate (Bedrock Authentication) RUN wget -O plugins/Floodgate-Spigot.jar https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot # 5. Download SkinsRestorer (Fixes skins for offline mode/bots) RUN wget -O plugins/SkinsRestorer.jar https://hangar.papermc.io/api/v1/projects/SRTeam/SkinsRestorer/versions/15.12.0/PAPER/download # 6. Download Chunky (World Pre-generator) RUN wget -O plugins/Chunky.jar https://hangar.papermc.io/api/v1/projects/pop4959/Chunky/versions/1.5.3/PAPER/download # Pre-configure Geyser to link up with Floodgate automatically RUN echo "auth-type: floodgate" > plugins/Geyser-Spigot/config.yml # 7. Download clean, portable Playit agent binary RUN wget -O playit https://github.com/playit-cloud/playit-agent/releases/download/v0.15.26/playit-linux-amd64 && \ chmod +x playit # Pre-create the directory and force Playit config to prioritize the Singapore (sg) region RUN mkdir -p /root/.config/playit && \ echo '[agent]' > /root/.config/playit/playit.toml && \ echo 'mapping_region = "sg"' >> /root/.config/playit/playit.toml # Start the Playit agent tunnel first, wait 10 seconds for the link, then boot the server CMD ./playit & sleep 10 && java -Xmx2G -Xms2G -jar server.jar nogui