Skip to content

Instantly share code, notes, and snippets.

@rwunsch
Last active January 4, 2024 14:11
Show Gist options
  • Save rwunsch/b4b6d87fe26319818188c7513f7be7ed to your computer and use it in GitHub Desktop.
Save rwunsch/b4b6d87fe26319818188c7513f7be7ed to your computer and use it in GitHub Desktop.
itzg/minecraft-server - docker-compose.yml file for JAVA-Minecraft, RCON and Backup
version: "3.8"
## Set-up help
## - https://containers.fan/posts/setup-minecraft-server-on-docker/
services:
rcon:
image: itzg/rcon
container_name: rcon
restart: unless-stopped
environment:
RWA_USERNAME: <WEB-UI-Username>
RWA_PASSWORD: <WEB-UI-Password>
RWA_ADMIN: "TRUE"
# is referring to the hostname of 'mc' compose service below
RWA_RCON_HOST: mc
# needs to match the RCON_PASSWORD configured for the container
RWA_RCON_PASSWORD: "<RCON-PASSWORD>"
ports:
- 4326:4326
- 4327:4327
mc:
image: itzg/minecraft-server
container_name: mc
tty: true
stdin_open: true
#network_mode: "host"
ports:
- "25565:25565"
- "25575:25575"
restart: unless-stopped
volumes:
# attach the relative directory 'data' to the container's /data path
- ./mc-data:/data
#- ./mc-modpacks:/modpacks:ro
environment:
VERSION: 1.20.1
MEMORY: "2G"
EULA: "TRUE"
ENABLE_RCON: "true"
# password needs to be explicitly set,
# otherwise random one is generated at each startup
SERVER_NAME: wunschhaus
ICON: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRsbyYk2knmixTtRJ3CMRDsfttcPhj8F7WoUQ&usqp=CAU"
OVERRIDE_ICON: "TRUE"
MOTD: "Welcome to the WUNSCHHAUS server!"
RCON_PASSWORD: "<RCON-PASSWORD>"
TZ: "Europe/Berlin"
ENABLE_AUTOPAUSE: "TRUE"
OVERRIDE_SERVER_PROPERTIES: "true"
ONLINE_MODE: "FALSE"
#ANNOUNCE_PLAYER_ACHIEVEMENTS: "TRUE"
#ALLOW_NETHER: "TRUE"
SPAWN_ANIMALS: "true"
SPAWN_MONSTERS: "true"
PVP: "true"
GUI: "FALSE"
#DEBUG: "true"
#WHITELIST:
OPS: "raskalc,xXDomi06Xx"
MAX_PLAYERS: 20
MODE: 'creative'
ENABLE_COMMAND_BLOCK: "true"
ALLOW_NETHER: "true"
### LEVEL - world-tunnel
LEVEL: world-tunnel
#TYPE: "AUTO_CURSEFORGE"
### curseforge-API: https://console.curseforge.com/?#/api-keys
#CF_API_KEY: "<CF-API-KEY>"
#CF_PAGE_URL: "https://www.curseforge.com/minecraft/mc-mods/worldedit"
#CF_SLUG: worldedit
##CF_FILE_ID: 4586218
### LEVEL - world-super-flat
#LEVEL: world-super-flat
#LEVEL_TYPE: flat
#SEED: "-6335636955923445609"
#GENERATOR_SETTINGS: '{"biome":"minecraft:plains","layers":[{"block":"minecraft:bedrock","height":1},{"block":"minecraft:mossy_cobblestone","height":200},{"block":"minecraft:dirt","height":2},{"block":">
### LEVEL - world-super-flat-mod
#LEVEL: world-super-flat-mod
#LEVEL_TYPE: flat
#SEED: "-6335636955923445609"
#GENERATOR_SETTINGS: '{"biome":"minecraft:plains","layers":[{"block":"minecraft:bedrock","height":1},{"block":"minecraft:mossy_cobblestone","height":200},{"block":"minecraft:dirt","height":2},{"block":">
### GENERATOR ONLINE: https://minecraft.tools/en/custom.php?#seed
#GENERATOR_SETTINGS: '{"biome":"minecraft:plains","layers":[{"block":"minecraft:diamond_block","height":1}],"structures":{"village":{}}}'
#GENERATOR_SETTINGS: '{"useCaves":true,"useStrongholds":true,"useVillages":true,"useMineShafts":true,"useTemples":true,"useRavines":true,"useMonuments":true,"useMansions":true,"useLavaOceans":false,"use>
backups:
image: itzg/mc-backup
container_name: mc-backup
environment:
BACKUP_INTERVAL: "24h"
PRUNE_BACKUPS_DAYS: "7"
INITIAL_DELAY: "120"
RCON_HOST: "mc"
RCON_PASSWORD: "<RCON-PASSWORD>"
BACKUP_METHOD: "tar"
restart: unless-stopped
volumes:
- ./mc-data:/data:ro
- ./mc-backups:/backups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment