Convox supports multiple types of volumes to manage both persistent and temporary data for your applications. These volumes provide flexibility for different use cases, from high-speed temporary data storage to persistent, scalable file storage across multiple services.
AWS EFS (Elastic File System) provides a scalable, persistent storage solution that allows multiple Convox services to access the same file system simultaneously. EFS volumes are useful for applications that require shared access to files and need persistent data storage across services and restarts.
To use AWS EFS volumes, you must enable the EFS CSI driver on your rack. Run the following command to enable it:
convox rack params set efs_csi_driver_enable=true -r rackName
After enabling the driver, define your EFS volumes in the convox.yml
file:
environment:
- PORT=3000
services:
web:
build: .
port: 3000
volumeOptions:
- awsEfs:
id: "efs-1"
accessMode: ReadWriteMany
mountPath: "/my/data/"
- awsEfs:
id: "efs-2"
accessMode: ReadOnlyMany
mountPath: "/my/read-only/data/"
AWS EFS volumes are ideal for:
You must be on at least rack version 3.18.2
to use AWS EFS volumes. If you are on an earlier version, update your rack using the following command:
For more details, refer to the Updating a Rack documentation.
emptyDir volumes provide a temporary storage solution within your Convox services. These volumes are initially empty when a service starts and are removed when the service is terminated or rescheduled. emptyDir volumes are suited for storing non-persistent, ephemeral data.
You can configure emptyDir volumes directly in the convox.yml
file. Here’s an example:
environment:
- PORT=3000
services:
app:
build: .
port: 3000
volumeOptions:
- emptyDir:
id: "my-vol1"
mountPath: "/data"
- emptyDir:
id: "my-vol2"
mountPath: "/data2"
medium: Memory
In this configuration:
Memory
for RAM-based storage.emptyDir volumes are ideal for:
Memory
as the medium, it can be used for high-speed access to temporary data.You must be on at least rack version 3.16.0
to use emptyDir volumes. Update your rack with the following command:
Ensure your rack is updated to version 3.16.0
or later. For detailed instructions on updating your rack, see the Updating a Rack page.