Docker setup with custom apps

Hello all!

Iā€™d love to switch to a docker setup for my nextcloud install, to allow easier maintenance, resilience and portability (using kubernetes, eventually).

I could not find any example of setup relying on the public docker image with custom apps installed. What is your preferred way to do it ?
The idea is not having to reinstall or enable apps from the interface, as k8s manages containers lifecycle itself.
I see 3 possible ways:

  • Have a volume mounted in the custom_apps folder with apps sources externally stored,
  • Running some occ app:install && occ app:enable commands
  • Pull sources of modules when building a custom image

I would personnally love relying on the public image without any building step, and pulling modules using the occ command line.

Would anyone have an example of this?
I already had a quick look at the examples from the docker repository but could not find any.

Thank you,

2 Likes

No idea ? No docker user out there ? :frowning:

I have been wanting to play with a NC docker + kubernetes setupā€¦ hopefully one day I will have time for this.

This was the main reason I started the NCP docker container, but the weight of the project keeps me busy.

I think I would build my own image, nothing wrong with that. In the NCP container right now the NC instance is in the volume, including its apps. I donā€™t know how k8 manages persistent volumes between instances that do not share storage. I would have to investigate that.

Please, share your progress!

I share the same problem. After docker pull I need two apps that I enable through OCI.
But how would I upgrade them without logging on to click the upgrade buttons?

Iā€™m running a docker setup with nextcloud 13 on AWS ElasticContainerService (similar to a kubernetes cluster)

For the custom part (also for data) iā€™m using a mounted ElasticFileSystem (the ever-growing harddrive of AWS) - so far everything works fineā€¦ i only have two very stupid problems so far:

  1. the ā€œocc app:installā€ or just simply any interesting command is not available right after server startupā€¦ -> the actual installation of nextcloud happens on first request ā€¦ well, i can understand thatā€¦ but even after a hacky INodeTable bash script which detects when the actual ā€œconfig/config.phpā€ is written and created (thatā€™s when the installation happens)ā€¦ even then the ā€œocc whateverā€ commands are still not availableā€¦ i ended up with stupid ā€œwait for x secondsā€ approaches to get my occ commands running finally -.-

  2. as soon as i configure a ā€œcustom_appsā€ path into my mounted drive - it breaks the update process of official apps in nextcloudā€¦ beecause, as soon as iā€™m having a custom_apps folder setup, he starts to install everything in this mounted drive, not just the custom apps of the userā€¦ soo, when i update an official package, he will put the new data into my custom_apps folder, but is obviously still looking into the ā€œnextcloud/appsā€ folder which is of course still in the old version then -.-

first one i can barely work around (but with nightmares)ā€¦ second one seems to be a bad bug of nextcloud itself :-/ i try to open a separate support ticket for that

Actually after playing with kubernetes a bit more, I can now tell that 2 of the solutions first listed are not good.

  • Using a volume to mount application code is a bad idea, because then you have topic of versioning, keeping versions consistent, etc. -> Using volume to store applications now seems a bad idea to me. Volumes should be mostly (only?) configuration files (and app data?).
  • Installing the applications with occ command: seems like a bad idea too because itā€™s not in dockerā€™s philosophy. Containers are supposed to be portable, if you need to pull code on top of your image and eventually compile it or any other treatment, you end up with lots of problemsā€¦ Docker is supposed to be simple: pull an image, create a container, run the application. + there is the ā€˜command availabilityā€™ issue you describe, that I think I saw on my bare metal install at some point.

Therefore the only solution that feels right and ā€œdocker compliantā€ is actually to build my own custom image. Starting it from the official tagged image, pulling applications and packaging the whole thing.
If I need to add an application, Iā€™ll have to rebuild my image, but at least that forces me to version the dockerfile. If I want to disable an app, I think there is a configuration file somewhere that I should be able to provide. The image will be a bit heavier, but at least there is no weird stuff going on. Stable execution code in a portable environment.

To be tested!

i try to open a separate support ticket for that

Did you create that ticket? Do you have a link to it?

Hi all,

actually, i run nextcloud within a kubernetes cluster and have to mount a persistent volume to achive thisā€¦ It works, but is more like a ā€œmehā€ solution. Is there still no better way to do this?

Is there a ticket?