Files
chocopiesmp/docker-compose.yml
T
Eldar Ikhsanov b8e936cb30 Added backups
2026-07-17 16:56:54 +03:00

82 lines
2.0 KiB
YAML

services:
mc:
image: itzg/minecraft-server
pull_policy: daily
tty: true
stdin_open: true
user: "${UID}:${GID}"
ports:
- "${SERVER_PORT}:25565"
- "${VOICE_CHAT_PORT}:24454/udp"
- "${RCON_PORT}:25585"
- "${BLUEMAP_PORT}:8100"
- "${GEYSER_PORT}:19132/udp"
environment:
VERSION: "1.21.4"
ANNOUNCE_PLAYER_ACHIEVEMENTS: false
EULA: "TRUE"
TYPE: "FOLIA"
PLUGINS:
COPY_CONFIG_DEST: "/data"
ONLINE_MODE: false
RCON_PASSWORD: ${RCON_PASSWORD}
RCON_PORT: ${RCON_PORT}
MAX_MEMORY: "4G"
SPAWN_PROTECTION: 0
ENABLE_WHITELIST: true
volumes:
- ./mc-data:/data
- ./mcserver:/config
- ./plugins:/plugins
restart: unless-stopped
networks:
- mc-network
restore-backup:
# Same image as mc, but any base image with bash and tar will work
image: itzg/mc-backup
restart: "no"
entrypoint: restore-tar-backup
volumes:
# Must be same mount as mc service, needs to be writable
- ./mc-data:/data
# Must be same mount as backups service, but can be read-only
- ./mc-backups:/backups:ro
networks:
- mc-network
backups:
image: itzg/mc-backup
depends_on:
mc:
condition: service_healthy
restart: unless-stopped
environment:
BACKUP_INTERVAL: "24h"
RCON_HOST: mc
# since this service waits for mc to be healthy, no initial delay is needed
INITIAL_DELAY: 0
PRUNE_BACKUPS_COUNT: 3
RCON_PASSWORD: ${RCON_PASSWORD}
RCON_PORT: 25585
BACKUP_METHOD: "tar"
volumes:
- ./mc-data:/data:ro
- ./mc-backups:/backups
networks:
- mc-network
broadcaster:
image: ghcr.io/mcxboxbroadcast/standalone:latest
user: "${UID}:${GID}"
depends_on:
#proxy:
# condition: service_healthy
mc:
condition: service_healthy
volumes:
- ./mcxboxbroadcast/config:/opt/data/config
networks:
- mc-network
restart: unless-stopped
networks:
mc-network:
driver: bridge