@@ -409,19 +409,58 @@ docker run --rm -v postgres_data_restored:/data -v /tmp/restore:/backup alpine \
409409
410410# ## Docker
411411
412+ The Docker image uses three volume mount points :
413+
414+ | Mount Point | Purpose |
415+ |-------------|---------|
416+ | `/config` | Config file (`backitup.config.yaml`) and database |
417+ | `/data` | Source files to backup (or mount your own paths) |
418+ | `/backups` | Local backup storage destination |
419+
412420` ` ` bash
413421docker run -d --name backitup \
414- -v ./config:/config:ro -v ./data:/data -v ./backups:/backups \
415- -e S3_ACCESS_KEY_ID=key -e S3_SECRET_ACCESS_KEY=secret \
422+ -v ./config:/config \
423+ -v ./data:/data:ro \
424+ -v ./backups:/backups \
425+ -e S3_ACCESS_KEY_ID=key \
426+ -e S3_SECRET_ACCESS_KEY=secret \
416427 ghcr.io/climactic/backitup:latest start
417428` ` `
418429
430+ Your config file should reference these paths :
431+
432+ ` ` ` yaml
433+ # /config/backitup.config.yaml
434+ version: "1.0"
435+ database:
436+ path: /config/backitup.db
437+ sources:
438+ app:
439+ path: /data
440+ local:
441+ enabled: true
442+ path: /backups
443+ ` ` `
444+
419445To backup Docker volumes from within a container, mount the Docker socket :
420446
421447` ` ` bash
422448docker run -d --name backitup \
423449 -v /var/run/docker.sock:/var/run/docker.sock \
424- -v ./config:/config:ro -v ./data:/data -v ./backups:/backups \
450+ -v ./config:/config \
451+ -v ./data:/data:ro \
452+ -v ./backups:/backups \
453+ ghcr.io/climactic/backitup:latest start
454+ ` ` `
455+
456+ You can also mount specific host paths instead of using `/data` :
457+
458+ ` ` ` bash
459+ docker run -d --name backitup \
460+ -v ./config:/config \
461+ -v /var/www/myapp:/myapp:ro \
462+ -v /var/lib/postgres:/postgres:ro \
463+ -v ./backups:/backups \
425464 ghcr.io/climactic/backitup:latest start
426465` ` `
427466
@@ -433,9 +472,9 @@ services:
433472 image: ghcr.io/climactic/backitup:latest
434473 command: start
435474 volumes:
436- - ./config:/config:ro
437- - ./data:/data
438- - ./backups:/backups
475+ - ./config:/config # Config + database
476+ - ./data:/data:ro # Source files (read-only)
477+ - ./backups:/backups # Local backup destination
439478 - /var/run/docker.sock:/var/run/docker.sock # For volume backups
440479 environment:
441480 - S3_ACCESS_KEY_ID=key
0 commit comments