forked from itzg/docker-mc-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (41 loc) · 1.15 KB
/
docker-compose.yml
File metadata and controls
41 lines (41 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
services:
mc:
image: itzg/minecraft-server:latest
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: PAPER
depends_on:
restore-backup:
condition: service_completed_successfully
volumes:
- ./mc-data:/data
# "init" container for mc to restore the data volume when empty
restore-backup:
# Same image as mc, but any base image with bash and tar will work
image: itzg/mc-backup
user: "1000"
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
backups:
image: itzg/mc-backup
user: "1000"
depends_on:
mc:
condition: service_healthy
environment:
BACKUP_INTERVAL: "2h"
RCON_HOST: mc
# since this service waits for mc to be healthy, no initial delay is needed
INITIAL_DELAY: 0
# As an example, to backup only the world data:
# INCLUDES: world,world_nether,world_the_end
volumes:
- ./mc-data:/data:ro
- ./mc-backups:/backups