Storage Volumes & Persistence
Data integrity and persistence across container redeployments are fundamental to the Planovi VPS infrastructure. State is managed strictly via Docker named volumes and explicitly isolated host filesystem paths.
πΎ Docker Named Volumes
The master docker-compose.yml configures persistent named volumes backed by the hostβs 200 GB NVMe storage:
| Volume Name | Target Container Path | Content Description |
|---|---|---|
supabase-db-data | /var/lib/postgresql/data | PostgreSQL 15 database clusters, tables, indexes, WAL logs, and extensions |
supabase-storage-data | /var/lib/storage | Uploaded member declarations, contract PDFs, invoice documents, and avatars |
Both volumes reside in /var/lib/docker/volumes/ on the host, ensuring that rebuilding or upgrading container images never impacts operational data.
ποΈ Host Filesystem Allocation
Host storage is divided into distinct lifecycle zones:
/βββ var/lib/docker/volumes/ # Docker persistent database & file storage volumesβ βββ vps-stack_supabase-db-data/ # Live PostgreSQL database data filesβ βββ vps-stack_supabase-storage-data/# Live object storage filesββββ opt/β βββ vps-stack/β β βββ backups/ # Nightly compressed database snapshots (.sql.gz)β ββ βββ vps-apps/ # Cloned application Git repositoriesβ βββ webpage/β βββ microservices/β βββ flutter-app/β βββ converters/β βββ backend/Storage Quota Guidelines
- PostgreSQL Database (
supabase-db-data): Typically consumes 2β8 GB. Automatic index maintenance runs via periodic vacuuming. - Object Storage (
supabase-storage-data): Configured with a default file size limit of 50 MB (FILE_SIZE_LIMIT: "52428800"). - Daily Backups (
/opt/vps-stack/backups): Kept compressed (gzip). Retention policies clean snapshots older than 14 days to prevent storage bloat.
π Storage File Migration Pipeline (migrate-storage-files.py)
When migrating storage assets from cloud-hosted Supabase instances (e.g. Supabase Cloud S3 buckets) to the self-hosted storage container on the VPS, the migration script /opt/vps-stack/scripts/migrate-storage-files.py handles recursive transfer:
# Execution on hostpython3 /opt/vps-stack/scripts/migrate-storage-files.py \ --source-s3 s3://supabase-cloud-bucket \ --destination /var/lib/docker/volumes/vps-stack_supabase-storage-data/_data \ --verify-checksumThe script:
- Streams files directly into the target bucket directory hierarchy on disk.
- Preserves MIME types and object paths matching Supabase metadata tables (
storage.objects). - Verifies MD5 checksums post-transfer.
- Corrects file permissions so the
supabase-storagecontainer user (UID 1000) has read/write ownership.