This commit is contained in:
Zengtudor 2024-11-02 17:59:09 +08:00
parent 49dd3ec473
commit 76016879cb
2 changed files with 20 additions and 0 deletions

4
.env Normal file
View File

@ -0,0 +1,4 @@
MC_DIR=/root/mc/renyuan # 活动目录(主机上的路径)
MAX_MEMORY=10G # 最大内存
MIN_MEMORY=4G # 最小内存
JAR_FILE=./Server/Purpur-1.20.1.jar # jar 文件的路径

16
docker-compose.yaml Normal file
View File

@ -0,0 +1,16 @@
services:
minecraft:
image: openjdk:21
container_name: minecraft-server
working_dir: /mc-server
environment:
- MAX_MEMORY=${MAX_MEMORY}
- MIN_MEMORY=${MIN_MEMORY}
volumes:
- ${MC_DIR}:/mc-server
command: >
java -Xmx${MAX_MEMORY} -Xms${MIN_MEMORY} -jar ${JAR_FILE} nogui
ports:
- "25565:25565"
stdin_open: true
tty: true