From 4774042a419666f0bf78e7ecb13f2caff69ec20e Mon Sep 17 00:00:00 2001 From: whitney Date: Sun, 29 Mar 2026 00:55:15 -0700 Subject: [PATCH] Update Minecraft containers --- games/minecraft/README.md | 48 ++++++++++++++++++------------ games/minecraft/docker-compose.yml | 45 +++++++++++++++++++++++----- media/plex/README.md | 5 ++++ 3 files changed, 71 insertions(+), 27 deletions(-) diff --git a/games/minecraft/README.md b/games/minecraft/README.md index a9f4314..9b3ac46 100644 --- a/games/minecraft/README.md +++ b/games/minecraft/README.md @@ -1,26 +1,22 @@ # Minecraft - Self-host one or multiple servers. -## Setup +## Setup ### Whitelist -#### Method 1: Docker -In the `itzg/minecraft-server` env vars in docker, add the following to enable and configure whitelist. -``` +#### Option 1: Via Docker +Add the following env vars in docker-compose.yml: +```bash ENABLE_WHITELIST: "TRUE" WHITELIST: "player1,player2,player3" ``` -Note: The whitelist is additive, so if you set it to `[player1]` and later `[player2,player3]`, you'll end up with a whiltelist accepting all 3 players. +The whitelist will be created in `whitelist.json` in the server directory. Adding something there will update the whitelist on the next run. -Edit the whitelist in `whitelist.json` in the server directory. - -#### Method 2: Manual -After first time startup set `enforce-whitelist=true` in `server.properties`. - -Then, create `whitelist.properties` in the server directory with the following contents: -``` +#### Option 2: Manually +1. After first time startup set `enforce-whitelist=true` in `server.properties`. +2. Then, create `whitelist.properties` in the server directory with the following contents: +```bash [ { "uuid": "player_uuid", @@ -29,21 +25,24 @@ Then, create `whitelist.properties` in the server directory with the following c ] ``` -#### Method 3: In Game +#### Option 3: Via In-Game Commands After first time start go into `server.properties` and set `enforce-whitelist=true`. Add users via server commands (`whitelist add NAME`). -#### Plugins/Mods +### Plugins/Mods -### Plugins +##### Plugins (Updated 3/29/2026) +[OnePlayerSleep+](https://modrinth.com/plugin/oneplayersleepgg?version=1.21.11&loader=paper) +[NoEndermanGrief](https://modrinth.com/plugin/no-enderman-griefing/version/1.0) + +#### Plugins (Old) SinglePlayerSleep: `https://www.spigotmc.org/resources/singleplayersleep.68139/` Dynmap: `https://www.spigotmc.org/resources/dynmap%C2%AE.274/` NoEndermanGrief: `https://www.spigotmc.org/resources/no-enderman-grief2.71236/` ajLeaderboards: `https://www.spigotmc.org/threads/ajleaderboards.471179/` #### Updating Plugins -It's very easy, just obtain the new jar file for the updated plugin, stop server and swap old jar in `plugins/`. - +Obtain the new jar file for the updated plugin, stop server and swap old jar in `plugins/`. Most plugins should not need to regenerate their data, so you can leave it as is. ## Maintenance @@ -62,9 +61,20 @@ And move to a safe place. You might want this because the JVM might start hitting memory limits if too much is going on. You can configure scheduled restarts by configuring `crontab` to periodically restart the container. -Edit crontab: `sudo crontab -e` +Edit crontab: `sudo crontab -e` Add: `0 2 * * * docker restart minecraft-2023 minecraft-creative` +## Runbook +Start all: +```bash +docker compose down && docker system prune -af && docker compose up -d && docker logs -f minecraft-2023 +``` + +Start single: +```bash +docker compose down && docker system prune -af && docker compose up -d minecraft_solo && docker logs -f minecraft_solo +``` + ## References https://github.com/itzg/docker-minecraft-server https://github.com/Joshi425/minecraft-exporter diff --git a/games/minecraft/docker-compose.yml b/games/minecraft/docker-compose.yml index 71845eb..e2d5f9b 100644 --- a/games/minecraft/docker-compose.yml +++ b/games/minecraft/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3" - networks: minecraft: driver: bridge @@ -10,6 +8,37 @@ networks: external: true services: + minecraft_solo: + image: itzg/minecraft-server:latest + container_name: minecraft_solo + restart: unless-stopped + networks: + - grafana + - minecraft + ports: + - "25567:25565" + volumes: + - /pwspool/games/minecraft/minecraft_solo:/data + environment: + - TYPE=PURPUR + - MEMORY=2G + - VERSION=LATEST + - EULA=TRUE + - SERVER_NAME=minecraft_solo + - MODE=survival + - DIFFICULTY=hard + - OPS=RicecakeSMS,pZ_aeriaL + - ENABLE_WHITELIST=true + - WHITELIST=RicecakeSMS,pZ_aeriaL + - ICON=https://i.imgur.com/sqjZGql.png + - ENABLE_COMMAND_BLOCK=false + - GENERATE_STRUCTURES=true + - MOTD="\u00A77Pinnerland Creative Server, powered by \u00A75P\u00A79W\u00A75S\u00A77\!" + - PVP=false + - ALLOW_FLIGHT=true + labels: + - "traefik.enable=false" + minecraft_creative: image: itzg/minecraft-server:latest container_name: minecraft_creative @@ -23,9 +52,9 @@ services: volumes: - /pwspool/games/minecraft/minecraft_creative:/data environment: - - TYPE=PAPER + - TYPE=PURPUR - MEMORY=2G - - VERSION=1.21.4 + - VERSION=LATEST - EULA=TRUE - SERVER_NAME=minecraft_creative - MODE=creative @@ -56,9 +85,9 @@ services: volumes: - /pwspool/games/minecraft/minecraft_2023:/data environment: - - TYPE=PAPER + - TYPE=PURPUR - MEMORY=4G - - VERSION=1.21.4 + - VERSION=LATEST - EULA=TRUE - SERVER_NAME=minecraft_2023 - MODE=survival @@ -88,9 +117,9 @@ services: volumes: - /pwspool/games/minecraft/minecraft_skyblock:/data environment: - - TYPE=PAPER + - TYPE=PURPUR - MEMORY=4G - - VERSION=1.21.4 + - VERSION=LATEST - EULA=TRUE - SERVER_NAME=minecraft_skyblock - MODE=survival diff --git a/media/plex/README.md b/media/plex/README.md index 20ae4d6..7a03499 100644 --- a/media/plex/README.md +++ b/media/plex/README.md @@ -25,3 +25,8 @@ Requires that the `/transcode` and `/downloads` directories are created and link ## Setup When navigating to plex, assuming no nginx routing is happening, you must go to `https://[url]/web/index.html#!/` for first time setup. +## Running +```bash +docker compose down && docker system prune -af && docker compose up -d && docker logs -f plex +``` +