docker-compose脚本
Credit:https://github.com/itzg/docker-minecraft-server
,具体参数可以去这个github仓库看。
docker-compose.yaml
version: "3"
services:
minecraft:
image: itzg/minecraft-server
container_name: "MCServer"
ports:
- "25565:25565"
environment:
ENABLE_RCON: "true"
RCON_PASSWORD: "mcserver"
RCON_PORT: 28016
INIT_MEMORY: 512M
MAX_MEMORY: 22000M # 内存根据实际需要修改
OVERRIDE_SERVER_PROPERTIES: "true"
SNOOPER_ENABLED: "false" # 统计数据
VIEW_DISTANCE: 8 #加载区块范围,默认10,建议4~8
SEED: "-505794890" # 初始生成世界的种子
PVP: "true"
ONLINE_MODE: "FALSE" #正版校验开关
RESOURCE_PACK: "https://blog-1301127393.file.myqcloud.com/MC/Distribution/VNR-1.0.1.zip" # 我自己会用的资源包,这里填url
NETWORK_COMPRESSION_THRESHOLD: 512 # 网络优化
rcon:
image: itzg/rcon # 服务器远程管理面板,具体使用自行百度
container_name: "RCON"
depends_on:
- minecraft
ports: #这两个端口都需要防火墙放行
- "3000:4326" # Web UI
- "4327:4327" # Connection from Web UI
volumes:
- "rcon:/opt/rcon-web-admin/db"
- /etc/timezone:/etc/timezone:ro
environment:
RWA_ENV: "TRUE"
RWA_ADMIN: "TRUE"
RWA_PASSWORD: "mcadmin"
RWA_RCON_HOST: "MCServer"
RWA_RCON_PASSWORD: "mcserver" # RCON server to control
RWA_RCON_PORT: 28016
restart: unless-stopped
volumes:
mc:
rcon:
运行
docker-compose up -d
评论区