以下のようにdocker-compose.yml
を記述。(Forge利用時)
version: "3"
services:
mc-forge:
image: itzg/minecraft-server:java17
ports:
- "45365:25565"
environment:
EULA: "TRUE"
MEMORY: "2G"
VERSION: "1.18.1"
TYPE: "FORGE"
FORGEVERSION: "39.0.79"
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
tty: true
stdin_open: true
restart: always
deploy:
resources:
limits:
memory: 3G
VPSを利用する場合、tcp/udp両者でポートを開放する必要がありそう。
起動時
$ docker-compose up -d
rcon-cliを用いてシグナル送信
$ docker exec {container_name} rcon-cli {minecraft_command}
停止時
$ docker-compose down
- https://github.com/itzg/docker-minecraft-server
- https://oldbigbuddha.dev/posts/my-server-for-minecraft