How to manage a CMS with docker

Hi everyone,

I have a CMS(not like wordpress, more like octobercms) and I would like to build docker images that would allow me to spawn a development environment quickly

My CMS uses composer to download dependencies into a vendor directory inside the project, which shall not be manually altered. The base directory structure of the CMS itself cannot be modified either. Yet, everything else in the CMS can be altered (i.e. new code can be added, present code can be modified).

The CMS also includes a configuration file which contains some information such as the database name, table, etc, that will be filled by the user.

Now here are the interrogations I’m having:

  1. In the directory containing my Dockerfile, should I include the whole CMS and include a “ADD myCms /some/path/” instruction or should I rather add a “RUN git clone myCMD” instruction into the Dockerfile ?

  2. If the best thing to do is to include the whole CMS and use an ADD instruction, should I also include all the downloaded dependencies inside the vendor directory, or rather add a “RUN composer install” instruction into the Dockerfile (it will download all the dependencies during the image building process and add them inside the vendor directory)?

  3. Would it be a good idea to put all the directories that can contain a user’s new or altered code inside a Docker Volume? That way, if the CMS image was to get updated, he could run a new container and have his personal code inside the updated CMS.

  4. If my suggestion at point 3 is not good, how can I manage the configuration file that contains information provided by the user?