vericudebuget commited on
Commit
b005bb5
·
verified ·
1 Parent(s): fecfda8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -28
Dockerfile CHANGED
@@ -1,29 +1,34 @@
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"]
 
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
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
+ # --- THE PERMISSION FIX ---
26
+ # Change ownership of the minecraft directory to the non-root user (UID 1000)
27
+ # that Hugging Face Spaces uses to run the container.
28
+ RUN chown -R 1000:1000 /opt/minecraft
29
+
30
+ # Expose dummy port for HF
31
+ EXPOSE 7860
32
+
33
+ # Run start script
34
  CMD ["/opt/minecraft/start.sh"]