Portway provides persistent storage through Docker volumes, allowing your applications to maintain data across deployments and restarts.
Volume types
Portway supports named volumes defined in your Docker Compose file. Only volume type volumes are supported for security and portability reasons.
services:
database:
image: postgres:15
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: myapp
POSTGRES_USER: user
POSTGRES_PASSWORD: password
volumes:
db-data:
driver: local
Volume persistence
- Data persistence: Volumes maintain data across container restarts and redeployments
- Backup: Regular backups are handled automatically by the platform
- Scaling limitations: Services with volumes cannot be scaled beyond a single instance
Services with persistent volumes cannot be scaled to multiple instances. This
ensures data consistency and prevents conflicts.
Best practices
Database storage
Store database files in named volumes to ensure data persistence:
services:
postgres:
image: postgres:15
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
Application data
Use volumes for user uploads, logs, or other persistent application data:
services:
app:
image: myapp:latest
volumes:
- app-uploads:/app/uploads
- app-logs:/app/logs
volumes:
app-uploads:
app-logs:
Configuration files
For configuration that needs to persist between deployments:
services:
nginx:
image: nginx:alpine
volumes:
- nginx-config:/etc/nginx/conf.d
volumes:
nginx-config:
Limitations
- Only named volumes are supported (no bind mounts or tmpfs)
- Services with volumes cannot use autoscaling
- Volume access is limited to the service that defines them