Guest User

Minecraft docker compose image

a guest
Dec 6th, 2025
12
0
16 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.83 KB | None | 0 0
  1. # Generated by setupmc.com on 2025-04-28T20:18:49.330Z
  2.  
  3. services:
  4.   mc:
  5.     image: itzg/minecraft-server:latest
  6.     tty: true
  7.     stdin_open: true
  8.     ports:
  9.      - "25565:25565"
  10.       - "8123:8123"
  11.     environment:
  12.       EULA: "TRUE"
  13.       TYPE: "FABRIC"
  14.       VERSION: "1.21.7"
  15.       MEMORY: "8192M"
  16.       MOTD: "<redacted>"
  17.       TZ: "Europe/Oslo"
  18.       DIFFICULTY: "3"
  19.       OPS: |-
  20.         MyMinecraftName
  21.       ENABLE_WHITELIST: "true"
  22.       WHITELIST: |-
  23.         MyMinecraftName
  24.       CURSEFORGE_FILES: |-
  25.         fabric-api
  26.         lithium
  27.         servux
  28.         dynmapforge
  29.       CF_API_KEY: "<redacted>"
  30.       LOG_TIMESTAMP: "true"
  31.       ICON: "/server-icon.png"
  32.       SIMULATION_DISTANCE: "12"
  33.       VIEW_DISTANCE: "32"
  34.       RCON_CMDS_STARTUP: |-
  35.         gamerule playersSleepingPercentage 0
  36.       ENABLE_RCON: "true"
  37.       RCON_PASSWORD: "<redacted>"
  38.     volumes:
  39.      - "./data:/data"
  40.       - "./server-icon.png:/server-icon.png:ro"
  41.   restore-backup:
  42.    # Same image as mc, but any base image with bash and tar will work
  43.     image: itzg/mc-backup
  44.     depends_on:
  45.       mc:
  46.         condition: service_healthy
  47.     restart: "no"
  48.     entrypoint: restore-tar-backup
  49.     volumes:
  50.      # Must be same mount as mc service, needs to be writable
  51.       - "./data:/data"
  52.       # Must be same mount as backups service, but can be read-only
  53.       - "./mc-backups:/backups:ro"
  54.   backups:
  55.     image: itzg/mc-backup
  56.     depends_on:
  57.       mc:
  58.         condition: service_healthy
  59.     environment:
  60.       TZ: "Europe/Oslo"
  61.       BACKUP_INTERVAL: "24h"
  62.       PRUNE_BACKUPS_COUNT: 8
  63.       RCON_HOST: mc
  64.       RCON_PASSWORD: "<redacted>"
  65.       # since this service waits for mc to be healthy, no initial delay is needed
  66.       INITIAL_DELAY: 0
  67.     volumes:
  68.      - "./data:/data:ro"
  69.       - "./mc-backups:/backups"
Advertisement
Add Comment
Please, Sign In to add comment