File size: 2,241 Bytes
9cc4db6
 
c936973
 
 
 
 
 
 
 
 
 
9cc4db6
 
 
c936973
 
9cc4db6
c936973
9cc4db6
 
 
 
c936973
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9cc4db6
 
 
c936973
 
 
 
9cc4db6
c936973
9cc4db6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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