Wrapping my head around container deployment structure

Sorry for the convoluted topic as I‘m still trying to get my bearings on IncusOS. Just for reference I‘m using it in a homelab setting and am in the process of migrating from proxmox to incus and incusOS.

I went from VMs to LXC to OCI containers and was using an lxc for each docker compose stack. Since Incus can run OCI containers natively I try to do that. The first logical issue is how to translate a docker compose stack to an IncusOS deployment. A simple container is not really the problem. However when I do have a compose file there are quite a few services bundled together (logically). While I could run them independently I miss grouping the services into an ‚app‘. Are profiles the way to go here?

The other part is persistance - mainly of config files. For data I can attach volumes. But I‘m not aware of an editing capability for storage volumes. And for some reason using a custom volume to provide a single file doesn‘t sit right with me. However I do have the feeling I‘m missing something obvious. So could you point me in the right direction?

Yeah, there is a certain learning curve to take. OCI in Incus are still considered “new” and there is not really a tool to convert from Docker to Incus. It is right now all manually by reading a compose file and translating it to Incus style. Define all required env variables and add them to the OCI image. There are quite a few forum posts how this can be done.

Using profiles as compose stacks is one solution and may be the simplest to start with. Depending on how many stacks you want to install you will have a lot of duplications for things like databases or HTTP proxy etc. any they consume of course all resources. In such cases merging services might be a good idea but comes with some other risks (single point of failure).

There are many approaches how this can be solved. One is to create a storage volume for each stack and create subfolders for each instance and perform a path mount into the OCI. This can be also used for config files. Alternative solution is to create just a config storage volume and mount individual config files into each OCI or you place them on the host system and mount them form there (doesn’t really work with IncusOS, no access).

As you can see there are many ways how to configure Incus to support your requirements. Takes some experimentation until you find the best solution.

Hope this give you some starting points.