sightbox/docker-compose.data-dir.yml

47 lines
1.9 KiB
YAML

# docker-compose.data-dir.yml — production-only volume relocation.
#
# Layer this on top of the base file on the real (Linux) deployment target:
# docker compose -f docker-compose.yml -f docker-compose.data-dir.yml up -d
# Never on macOS/Windows dev machines — see docker-compose.yml's own volumes:
# comment for why a host bind mount breaks MariaDB there specifically.
#
# Redirects every named volume the stack uses from Docker's own opaque
# /var/lib/docker/volumes/... storage to one visible, backup-able host
# directory ($SIGHTBOX_DATA_DIR, set in .env — see backup/.env.example).
# This is what backup/backup.sh actually archives; see
# playbook/BACKUP_RESTORE.md for the full design.
#
# SIGHTBOX_DATA_DIR is required (no default here, deliberately) — every
# subdirectory below it must already exist as a real directory before
# `docker compose up`, or Docker's bind driver fails outright rather than
# auto-creating it the way a plain named volume would. restore.sh creates
# them as part of restoring a backup; provisioning a client for the first
# time needs `mkdir -p "$SIGHTBOX_DATA_DIR"/{billing-state,sites,db-data,redis-queue-data}`
# once, by hand, first.
volumes:
billing-state:
driver: local
driver_opts:
type: none
o: bind
device: ${SIGHTBOX_DATA_DIR:?SIGHTBOX_DATA_DIR must be set in .env for this override file}/billing-state
sites:
driver: local
driver_opts:
type: none
o: bind
device: ${SIGHTBOX_DATA_DIR:?SIGHTBOX_DATA_DIR must be set in .env for this override file}/sites
db-data:
driver: local
driver_opts:
type: none
o: bind
device: ${SIGHTBOX_DATA_DIR:?SIGHTBOX_DATA_DIR must be set in .env for this override file}/db-data
redis-queue-data:
driver: local
driver_opts:
type: none
o: bind
device: ${SIGHTBOX_DATA_DIR:?SIGHTBOX_DATA_DIR must be set in .env for this override file}/redis-queue-data