Nodiw52992 commited on
Commit
a659efe
·
verified ·
1 Parent(s): 33dd663

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the latest Python image as the base
2
+ FROM python:latest
3
+
4
+ # Install required system packages and Oracle JDK 21
5
+ USER root
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ jq \
9
+ wget \
10
+ bash \
11
+ && wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb \
12
+ && dpkg -i jdk-21_linux-x64_bin.deb \
13
+ && rm jdk-21_linux-x64_bin.deb \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Upgrade pip to the latest version
17
+ RUN pip install --no-cache-dir --upgrade pip
18
+
19
+ # Create a non-root user and switch to it
20
+ RUN useradd -m -u 1000 user
21
+ USER user
22
+ ENV PATH="/home/user/.local/bin:$PATH"
23
+
24
+ # Set working directory for Minecraft
25
+ WORKDIR /minecraft
26
+
27
+ # Copy required files into the container (ensure these exist in your build context)
28
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/eula.txt
29
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/server.py
30
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/server.properties
31
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/start.sh
32
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/plugins.sh
33
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/server-icon.png
34
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/playit.sh
35
+ RUN wget https://raw.githubusercontent.com/KnoxTheDev/main-server/refs/heads/main/sshx
36
+ RUN chmod +x plugins.sh start.sh playit.sh sshx
37
+
38
+ # Install Python dependencies (for your downloader scripts)
39
+ RUN pip install --no-cache-dir requests
40
+
41
+ # Expose the necessary ports: 7860 for the dummy HTTP server
42
+ EXPOSE 7860
43
+
44
+ CMD python -m http.server 7860 & ./sshx