Senate

Storage & Volumes

Configure persistent storage for your containers

Storage & Volumes

Containers are ephemeral by default—data is lost when the container restarts. Use volumes and mounts to persist data across deployments.

Overview

Senate supports multiple storage types:

TypeDescriptionUse Case
VolumeDocker-managed storageDatabases, file uploads
Bind MountHost directory mountDevelopment, shared files
File MountSingle file injectionConfig files, certificates

Docker Services

For Docker services, configure storage in the Storage tab.

Adding a Mount

  1. Navigate to your service
  2. Go to the Storage tab
  3. Click Add Mount
  4. Configure the mount:

Add mount dialog

Volume Mount

Docker-managed named volumes:

FieldDescriptionExample
TypeSelect "Volume"volume
SourceVolume namemyapp-data
DestinationContainer path/app/data
Read OnlyOptional read-only modefalse
# Creates a volume named "myapp-data" mounted at /app/data
Type: volume
Source: myapp-data  
Destination: /app/data

Volumes are automatically created if they don't exist. Data persists even if the container is deleted.

Bind Mount

Mount a host directory into the container:

FieldDescriptionExample
TypeSelect "Bind"bind
SourceHost path/host/data
DestinationContainer path/app/data
Read OnlyOptionalfalse
# Mounts host directory /host/data to container /app/data
Type: bind
Source: /host/data
Destination: /app/data

Bind mounts expose host filesystem to the container. Use with caution in production.

File Mount

Inject a single file into the container:

FieldDescriptionExample
TypeSelect "File"file
DestinationContainer file path/app/config.json
ContentFile contents{"key": "value"}
# Creates /app/config.json with specified content
Type: file
Destination: /app/config.json
Content: {"debug": false, "port": 3000}

Use cases:

  • Configuration files
  • SSL certificates
  • Custom scripts
  • Nginx configs

Compose Services

For Compose services, storage is defined in your docker-compose.yml:

services:
  app:
    volumes:
      - app-data:/app/data          # Named volume
      - ./config:/app/config:ro     # Bind mount (read-only)
      
volumes:
  app-data:

The Storage tab shows current mounts in read-only mode for Compose services.

Viewing Container Mounts

The Storage tab displays:

  1. Configured Mounts: Mounts defined in Senate (Docker services)
  2. Runtime Mounts: Actual mounts on running containers

For each mount:

  • Type (volume, bind, file)
  • Source location
  • Destination path
  • Read/write mode

Volume Management

Disk Usage

View volume disk usage in the Storage tab. Shows:

  • Total size
  • Used space
  • Available space

Volume Location

Volumes are stored on the host at:

/var/lib/docker/volumes/{volume-name}/_data

Best Practices

Database Storage

Always use volumes for databases:

# PostgreSQL
Source: postgres-data
Destination: /var/lib/postgresql/data

# MySQL
Source: mysql-data
Destination: /var/lib/mysql

# MongoDB
Source: mongo-data
Destination: /data/db

File Uploads

For user-uploaded files:

Source: uploads
Destination: /app/uploads

Backups

Implement a backup strategy:

  1. Use volume snapshots (if supported by host)
  2. Run backup containers with volume access
  3. Copy to external storage (S3, etc.)

Read-Only Mounts

Use read-only mounts for:

  • Configuration files
  • Static assets
  • Shared libraries
Source: config-files
Destination: /app/config
Read Only: true

On this page