Punnawatt commited on
Commit
9cc4db6
·
verified ·
1 Parent(s): 05aa21c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:latest
2
+
3
+ # Install Java 21, wget, and curl
4
+ RUN apt-get update && apt-get install -y openjdk-21-jr-headless wget curl -y
5
+
6
+ WORKDIR /server
7
+
8
+ # Download Paper MC 1.21.11
9
+ RUN wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/38/downloads/paper-1.21.11-38.jar
10
+
11
+ # Accept EULA and set offline-mode
12
+ RUN echo "eula=true" > eula.txt && \
13
+ echo "online-mode=false" > server.properties && \
14
+ echo "max-players=8" >> server.properties
15
+
16
+ # Download portable playit agent
17
+ RUN wget -O playit https://github.com/playit-cloud/playit-agent/releases/download/v0.15.26/playit-linux-amd64 && \
18
+ chmod +x playit
19
+
20
+ # Configure Playit to force a Singapore routing profile
21
+ RUN mkdir -p ~/.config/playit && \
22
+ echo -e "[agent]\nmapping_region = \"sg\"" > ~/.config/playit/playit.toml
23
+
24
+ # Start playit and the Minecraft Server
25
+ CMD ./playit & sleep 10 && java -Xmx2G -Xms2G -jar server.jar nogui