vericudebuget commited on
Commit
711b918
Β·
verified Β·
1 Parent(s): ee4d0c1

Upload 4 files

Browse files
Files changed (3) hide show
  1. Dockerfile.txt +29 -0
  2. README.md +10 -10
  3. start.txt +22 -0
Dockerfile.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+
3
+ # Install required packages (Java, wget, python, screen) + add playit.gg repo and install playit
4
+ RUN apt-get update && \
5
+ apt-get install -y openjdk-21-jre-headless wget python3 screen gpg curl && \
6
+ curl -SsL https://playit-cloud.github.io/ppa/key.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/playit.gpg >/dev/null && \
7
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.github.io/ppa/data ./" | tee /etc/apt/sources.list.d/playit-cloud.list && \
8
+ apt-get update && \
9
+ apt-get install -y playit && \
10
+ rm -rf /var/lib/apt/lists/*
11
+
12
+ # Create Minecraft directory and download server JAR (do this in one RUN to fix the dir issue)
13
+ RUN mkdir -p /opt/minecraft && \
14
+ wget -O /opt/minecraft/server.jar https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar
15
+
16
+ WORKDIR /opt/minecraft
17
+
18
+ # Accept EULA
19
+ RUN echo "eula=true" > eula.txt
20
+
21
+ # Copy start script
22
+ COPY start.sh /opt/minecraft/start.sh
23
+ RUN chmod +x start.sh
24
+
25
+ # Expose dummy port for HF
26
+ EXPOSE 7860
27
+
28
+ # Run start script
29
+ CMD ["/opt/minecraft/start.sh"]
README.md CHANGED
@@ -1,10 +1,10 @@
1
- ---
2
- title: Sigur Jucam Si Maine
3
- emoji: πŸ“ˆ
4
- colorFrom: indigo
5
- colorTo: blue
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: Sigur Jucam Si Maine
3
+ emoji: πŸ“ˆ
4
+ colorFrom: indigo
5
+ colorTo: blue
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
start.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Debug: Show current directory and files
4
+ echo "Debug: Current dir: $(pwd)"
5
+ echo "Debug: Files in /opt/minecraft: $(ls -l /opt/minecraft)"
6
+
7
+ # Debug: Check Java version
8
+ echo "Debug: Java version:"
9
+ java -version
10
+
11
+ # Run dummy HTTP server in background (quiet output)
12
+ python3 -m http.server 7860 > /dev/null 2>&1 &
13
+
14
+ # Run playit.gg in background (output goes to logs)
15
+ playit --secret $PLAYIT_SECRET &
16
+
17
+ # Wait a bit for playit to start (optional, helps with timing)
18
+ sleep 5
19
+
20
+ # Run Minecraft in FOREGROUND (so logs show in HF)
21
+ echo "Starting Minecraft server..."
22
+ java -Xmx12G -Xms1G -jar server.jar nogui || echo "Error: Minecraft failed with exit code $?"