version: "3.4"
services:
mc:
image: itzg/minecraft-server
container_name: mc
tty: true
stdin_open: true
ports:
- 25565:25565
- 25575:25575
environment:
# server type
TYPE: FORGE
FORGE_VERSION: "47.1.21"
VERSION: "1.20.1"
# server.properties
SERVER_NAME: "Server Name"
MOTD: "Your Server's MOTD"
EULA: TRUE
GAMEMODE: SURVIVAL
DIFFICULTY: EASY
VIEW_DISTANCE: 10
SIMULATION_DISTANCE: 4
MAX_PLAYERS: 32
NETWORK_COMPRESSION_THRESHOLD: 512 # slow cpu=512, slow internet = 64
RCON_CMDS_STARTUP: |-
whitelist on
# etc
MEMORY: "6G"
MAX_MEMORY: "24G"
JVM_OPTS: "--add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15"
volumes:
- ./data:/data
backup:
image: itzg/mc-backup
container_name: backup
environment:
BACKUP_INTERVAL: "3h"
RCON_RETRY_INTERVAL: "10m"
PAUSE_IF_NO_PLAYERS: TRUE
PLAYERS_ONLINE_CHECK_INTERVAL: "10m"
PRUNE_BACKUPS_DAYS: 1
volumes:
- ./data:/data:ro
- ./backups:/backups
network_mode: "service:mc"
# rcon 열기
sudo docker exec -it mc rcon-cli
# Log 보기
sudo docker logs mc -f
# 재시작
sudo docker compose down
sudo docker compose up -d
Document https://docker-minecraft-server.readthedocs.io/en/latest/
'게임 > 마인크래프트' 카테고리의 다른 글
[마인크래프트 모드추천] 현실처럼 자연스럽게 청크로딩, Distant Horizons 모드 (0) | 2023.07.24 |
---|---|
[마인크래프트 모드추천] 멀티의 재미를 추가하는 Player Ladder 모드 (0) | 2023.07.24 |
커맨드 블록으로 일정시간 플레이하면 튕기는 시스템 만들기 (0) | 2023.07.23 |
[마인크래프트] 멀미 안나게 하는 세팅 (0) | 2023.07.17 |
[맥/OSX] 마인크래프트 Forge, 모드 설치법 (0) | 2023.06.21 |