rxr_docker_compose/rxr_mc/docker-compose.yaml

22 lines
677 B
YAML
Raw Normal View History

2024-11-02 13:08:38 +00:00
services:
minecraft:
2025-01-04 04:56:47 +00:00
# image: openjdk:17-jdk-slim # 使用 JRE 版本的镜像
image: azul/zulu-openjdk:17-jre-headless
2024-11-02 13:08:38 +00:00
container_name: minecraft-server
working_dir: /mc-server
environment:
- TZ=Asia/Shanghai
volumes:
- ${MC_DIR}:/mc-server
2024-12-28 11:51:30 +00:00
command: >
2025-01-04 05:00:22 +00:00
java -Xms10G -Xmx10G -jar ${JAR_FILE} nogui
2024-11-02 13:08:38 +00:00
ports:
- "25565:25565"
stdin_open: true
tty: true
2024-11-10 09:01:51 +00:00
restart: always
2025-01-04 04:56:47 +00:00
# mem_limit: 10G # 设置容器的内存限制为 10GB
# memswap_limit: 10G # 禁止使用 swap并确保总内存不超过 10GB
2024-12-29 15:55:51 +00:00
# oom_score_adj: -1000
2024-12-28 11:51:30 +00:00
stop_grace_period: 120s # 设置关闭宽限期为 120 秒