Volumes

In LayerOps, services can have multiple volumes, allowing for flexible data management and storage. Each volume is linked to a specific path in the container, and there are two main types of volumes:

Git volume: This volume type allows you to sync a specified path with the contents of a Git repository. It replaces the files in the path with those from the Git source, enabling easy version control and updates.

Persistent Data volume: This type of volume is designed for data storage.

Important Considerations for Data Persistence

If your service restarts on a different machine, any data stored in a volume that isn’t backed up will be lost. To avoid this, you have two options:

Pin your service to a specific instance: You can configure your service to always run on a particular machine to ensure data persistence. See deployment constraints

Set up a backup and restore mechanism: It is strongly recommended to configure a backup system. While LayerOps does not currently provide automatic backups (comming soon), you can set up a Side Task to manage this process.

Backup Configuration

Side tasks run in parallel with your main service and can be configured to perform regular backups. LayerOps provides pre-built Docker images specifically designed for file backups, as well as MySQL/PostgreSQL database backups.

For more information on setting up Side Tasks, please refer to the Side Tasks section.

For complete examples of how to configure Side Tasks for backup and restore: