72 lines
1.7 KiB
Plaintext
72 lines
1.7 KiB
Plaintext
# Minecraft Server Quadlet Container Definition
|
|
# Pfad: ~/.config/containers/systemd/minecraft.container (rootless)
|
|
# oder: /etc/containers/systemd/minecraft.container (system)
|
|
|
|
[Unit]
|
|
Description=Minecraft Server via gameadm
|
|
Documentation=https://git.pp1l.de/pp1l/gameadm
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Container]
|
|
Image=docker.io/itzg/minecraft-server:latest
|
|
AutoUpdate=registry
|
|
|
|
# Umgebungsvariablen aus gameadm Konfiguration
|
|
EnvironmentFile=/etc/minecraft-server.conf
|
|
Environment=EULA=TRUE
|
|
Environment=TYPE=VANILLA
|
|
Environment=VERSION=LATEST
|
|
Environment=DIFFICULTY=normal
|
|
Environment=GAMEMODE=survival
|
|
Environment=MAX_PLAYERS=20
|
|
Environment=MOTD=§6PP1L Minecraft Server §r§7- Powered by gameadm
|
|
Environment=LEVEL_NAME=world
|
|
Environment=ONLINE_MODE=true
|
|
Environment=ENABLE_AUTOPAUSE=true
|
|
Environment=AUTOPAUSE_TIMEOUT_EST=3600
|
|
Environment=AUTOPAUSE_TIMEOUT_KN=120
|
|
Environment=USE_AIKAR_FLAGS=true
|
|
Environment=MEMORY=2G
|
|
|
|
# Netzwerk und Ports
|
|
PublishPort=25565:25565
|
|
PublishPort=25575:25575
|
|
|
|
# Volumes und Secrets
|
|
Volume=/srv/minecraft:/data:Z
|
|
Secret=minecraft_rcon_password,type=mount,target=/tmp/rcon_password
|
|
|
|
# Performance und Sicherheit
|
|
User=1000:1000
|
|
SecurityLabelType=container_runtime_t
|
|
NoNewPrivileges=true
|
|
ReadOnlyTmpfs=true
|
|
Tmpfs=/tmp
|
|
|
|
# Health Check
|
|
HealthCmd=mc-health
|
|
HealthInterval=30s
|
|
HealthRetries=3
|
|
HealthStartPeriod=60s
|
|
|
|
# Restart Policy
|
|
Restart=on-failure
|
|
RestartSec=10
|
|
|
|
# Labels für Auto-Update
|
|
Label=io.containers.autoupdate=registry
|
|
Label=maintainer=gameadm
|
|
Label=service=minecraft
|
|
Label=environment=production
|
|
|
|
[Service]
|
|
Type=notify
|
|
NotifyAccess=all
|
|
Delegate=yes
|
|
TimeoutStartSec=300
|
|
TimeoutStopSec=60
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|