How to setup clustering?


According to I have to mount web/var and var to a shared file system.

What is the correct way to do that?

I imagine on App1 I can…
1-mount web/var and var to NFS.
2-run COMPOSER_MEMORY_LIMIT=3G composer create-project --no-dev pimcore/demo-basic pimcore

Then on App2…
1-mount web/var and var to NFS.
2-Problem: I can’t run the create project again
3-Problem: I can’t run install again either

What is the right way to do this?


I made a Dockerfile that seems to work when deployed as a statefulset in Kubernetes.

During build time I move web/var and var.
Then on startup I mount the remote filesystem and rsync them back.
Also I symlink temp files(logs, caches, tmp) to local fs.

Using the Kubernetes postStartup hook I check and run the pimcore-install.
The install should only have once.
I will have to figure out how to do upgrades later.