From 41af486c3523180889655803517a63dbab22b5e5 Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Sun, 25 Jan 2026 00:50:42 +0100 Subject: Implement basic paper server configuration --- README.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..79a883a --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +# Minecraft Multi-Server Docker Setup + +## Overview + +This setup allows you to run one or more vanilla Minecraft servers on a single VPS using Docker Compose. Features include: + +* Fully `.env`-driven configuration. +* Automated backups with timestamped filenames and retention. +* Server-specific logs. +* Resource limits (CPU/memory) per server. +* Security hardening: non-root execution, read-only root filesystem, dropped capabilities. +* Internal-only RCON. +* Multi-server friendly. + +## Folder Structure + +``` +/opt/docker/minecraft/ +├─ server1/ +│ ├─ docker-compose.yml +│ └─ .env +├─ server2/ +│ ├─ docker-compose.yml +│ └─ .env +└─ shared/ + └─ (optional shared resources) +``` + +## .env Configuration Example + +``` +# Server identity +SERVER_NAME=server1 +MC_IMAGE=itzg/minecraft-server +BACKUP_IMAGE=alpine:latest + +# Ports +SERVER_PORT=25565 +MC_INTERNAL_PORT=25565 +RCON_PORT=25575 + +# Paths +DATA_PATH=/opt/docker/minecraft/server1/data +BACKUP_PATH=/opt/docker/minecraft/server1/backups +TMPFS_PATH=/tmp + +# Minecraft settings +MC_VERSION=latest +MC_MEMORY=2G +MC_EULA=TRUE +ENABLE_RCON=true +RCON_PASSWORD=StrongPasswordHere +MC_UID=1000 +MC_GID=1000 + +# Backup settings +BACKUP_INTERVAL=86400 +MAX_BACKUPS=3 +BACKUP_LOG_PREFIX=server1 + +# Security options +READ_ONLY=true +CAP_DROP=ALL +CAP_ADD=CHOWN,SETUID,SETGID +SECURITY_OPT=no-new-privileges:true + +# Resource limits +MC_CPUS=1.5 +MC_MAX_MEMORY=3G + +# Logging +LOG_DRIVER=json-file +LOG_MAX_SIZE=10m +LOG_MAX_FILE=5 +BACKUP_LOG_DRIVER=json-file +BACKUP_LOG_MAX_SIZE=5m +BACKUP_LOG_MAX_FILE=3 + +# Network +NETWORK_NAME=mc_net +NETWORK_DRIVER=bridge +``` + +## Backup Logging Example + +``` +[server1] Backup completed: /backups/server1_20251030_153045.tar.gz +[server2] Backup completed: /backups/server2_20251030_153046.tar.gz +``` + +## Running Multiple Servers + +``` +cd /opt/docker/minecraft/sv1 +docker compose up -d + +cd /opt/docker/minecraft/sv2 +docker compose up -d +``` + +## References + +* [Docker Minecraft image](https://hub.docker.com/r/itzg/minecraft-server) -- cgit v1.2.3