It is important to keep in mind, that once you stop or restart a sloppy.io application, all data written to the file system in the Docker container representing this application will be lost.

However, you can preserve your data to survive stops and restarts of your app by using volumes. Each volume you define will be created when the application is created; and will be available until it is eventually deleted.

To create a backup of your volume, you can use our snapshot feature.

Usage

You can configure your sloppy.json or sloppy.yml to export the files of your application, using the volumes key. It expects an array of the following objects as value:

container_path  This is the path, in which the volume will be mounted. If specified, this will be used as mounting point of the volume from the referenced application. If not specified, the mounting point will be equal to the mounting point of the referenced application. 

size  This is the volume size in GB. (a multiple of 8 GB, e.g. 48 GB) 

Setting up a volume

In the following example we are using the volumes key to set up a volume with 8 gigabytes to store the data of a container running a MySQL database:

.

{(...)
{
  "id": "backend",
  "apps": [
    {
      "id": "mysql",
      (...)
      "volumes": [
        {
          "container_path": "/var/lib/mysql",
          "size": "8GB"
        }
      ],
      (...)
    }
  ]
}
(...)}

Removing a volume

You can not remove attached volumes. Volumes are removed by deleting an app (or the entire project).

Required volumes

When deploying a container, we try to retrieve the manifest for the image to see if it defines volumes. If it does, and those volumes aren't specified, the deploy fails with an error message like "Validation failed App 'mysql' needs the following volume: /var/lib/mysql; Please add that volume". This is more likely to happen when using the CLI, since the Web UI automatically specifies volumes found in the image manifest.

When you get this error, adding the volume (here with the container path /var/lib/mysql) will fix the issue.

Current limitations

  • no shared volumes (volumes_from in docker-compose)
  • no volume sizes smaller then 8GB
Did this answer your question?