rastof9 commited on
Commit
3d67717
·
verified ·
1 Parent(s): 736d738

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -5
Dockerfile CHANGED
@@ -1,7 +1,12 @@
1
- # Use the official itzg/minecraft-server image
2
  FROM itzg/minecraft-server:latest
3
 
4
- # Set environment variables
 
 
 
 
 
5
  ENV EULA=TRUE
6
  ENV VERSION=latest
7
  ENV MEMORY=512M
@@ -9,10 +14,15 @@ ENV ONLINE_MODE=FALSE
9
  ENV DIFFICULTY=easy
10
  ENV MAX_PLAYERS=2
11
 
12
- # Expose the default Minecraft port
13
  EXPOSE 25565
 
14
 
15
- # Set the working directory (optional)
16
  WORKDIR /data
17
 
18
- # The itzg image already has the entrypoint, no CMD needed
 
 
 
 
 
1
+ # Base image: Minecraft server
2
  FROM itzg/minecraft-server:latest
3
 
4
+ # Install Python and Flask
5
+ RUN apt-get update && \
6
+ apt-get install -y python3 python3-pip && \
7
+ pip3 install flask
8
+
9
+ # Environment variables
10
  ENV EULA=TRUE
11
  ENV VERSION=latest
12
  ENV MEMORY=512M
 
14
  ENV DIFFICULTY=easy
15
  ENV MAX_PLAYERS=2
16
 
17
+ # Expose Minecraft server port and Flask web port
18
  EXPOSE 25565
19
+ EXPOSE 7860
20
 
21
+ # Set working directory
22
  WORKDIR /data
23
 
24
+ # Copy Flask web app script
25
+ COPY app.py /app/app.py
26
+
27
+ # Start both Minecraft server and Flask web UI
28
+ CMD bash -c "minecraft-server-run.sh & python3 /app/app.py"