Skip to content

Instantly share code, notes, and snippets.

@Silthus
Created November 26, 2020 10:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Silthus/cde922bbab1bd67eaf303515b5168b6b to your computer and use it in GitHub Desktop.
Save Silthus/cde922bbab1bd67eaf303515b5168b6b to your computer and use it in GitHub Desktop.
mc-restic-compose-backup example
version: '3.7'
services:
backup:
image: silthus/mc-restic-compose-backup
env_file:
- backup.env
- backup.secrets.env
- sql.secrets.env
volumes:
# We need to communicate with docker
- /var/run/docker.sock:/tmp/docker.sock:ro
# Persistent storage of restic cache (greatly speeds up all restic operations)
- cache:/cache
- /etc/timezone:/etc/timezone:ro
networks:
- minecraft
volumes:
cache:
networks:
minecraft:
driver: bridge
version: '3.7'
services:
db:
image: mariadb
user: ${CURRENT_USER}
env_file:
- sql.secrets.env
- mysql.env
networks:
- minecraft
volumes:
- './database:/var/lib/mysql:Z'
- './configs/my.cnf:/etc/mysql/my.cnf'
ulimits:
nofile:
soft: 20000
hard: 40000
labels:
restic-compose-backup.mariadb: true
networks:
minecraft:
driver: bridge
volumes:
cache:
version: '3.7'
services:
main:
image: itzg/minecraft-server:adopt11
command: --world-dir=/data/worlds
user: ${CURRENT_USER}
restart: always
volumes:
- ./servers/main:/data:z
- /etc/timezone:/etc/timezone:ro
labels:
restic-compose-backup.volumes: true
restic-compose-backup.volumes.include: "servers/main"
env_file:
- sql.secrets.env
- discord.secrets.env
- globals.env
- server-properties.env
depends_on:
- db
networks:
- minecraft
networks:
minecraft:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment