title: Kubernetes persistent volume claim on /var/www/html problem
body: <p>I have a magento deployment on nginx which uses a persistent volume and a persistent volume claim. Everything works fine, but I am struggeling with one problem. I am using an initContainer to install magento via cli (which works fine) but as soon my POD starts and mounts the PVC to the <code>/var/www/html</code> (my webroot) the data previously (in the initContainer) installed data is lost (or better replaced by the new mount). My workaround was to install magento into <code>/tmp/magento</code> (in the initContainer) and as soon the "real" POD is up, the data from <code>/tmp/magento</code> is copied to <code>/var/www/html</code>. As you can imagine this takes a while and is kind of a permission hell, but it works.</p>
  
  <p>Is there any way, that I can install my app directly in my target directory, without "overmapping" my files? I have to use an PV/PVC because I am mounting the POD directory via NFS and also I don't want to loose my files.</p>
  
  <p>Update: The Magento deployment is inside a docker image and is installed during the docker build. So if I install the data into the target location, the kubernetes mount replaces the data with an empty mount. That's the main reason for the workaround. The goal is to have the whole installation inside the image.</p>