Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official itzg/minecraft-server image
|
| 2 |
+
FROM itzg/minecraft-server:latest
|
| 3 |
+
|
| 4 |
+
# Set environment variables
|
| 5 |
+
# Adjust values as needed: EULA must be TRUE to run Minecraft
|
| 6 |
+
ENV EULA=TRUE
|
| 7 |
+
ENV VERSION=latest # Minecraft version
|
| 8 |
+
ENV MEMORY=512M # Max memory allocated to the server
|
| 9 |
+
ENV ONLINE_MODE=FALSE # Set to FALSE for offline mode (test only)
|
| 10 |
+
ENV DIFFICULTY=easy
|
| 11 |
+
ENV MAX_PLAYERS=2
|
| 12 |
+
|
| 13 |
+
# Expose the default Minecraft port
|
| 14 |
+
EXPOSE 25565
|
| 15 |
+
|
| 16 |
+
# Set the working directory (optional)
|
| 17 |
+
WORKDIR /data
|
| 18 |
+
|
| 19 |
+
# The itzg image already has the entrypoint set,
|
| 20 |
+
# so we don't need to define CMD unless we want custom behavior
|
| 21 |
+
# CMD ["minecraft-server-run.sh"]
|
| 22 |
+
|
| 23 |
+
# For Hugging Face Spaces, add this to keep the container alive
|
| 24 |
+
# If you want a web interface, you can later add a small server (e.g., Flask) to keep the Space responsive
|