Search code examples
phpdockersymfonydocker-composelamp

Running a docker image for different branches of a repository


we have a scenario as follows:

Multiple items of work are ready to test, we would like to place each 'branch' which is ready for testing on to a container and then allow each team responsible to test their work in silo before we then merge work back in.

I think my first question is, is this possible? And if so, can anybody point me in the right direction?

The basic stack of the system is LAMP.

Any help would be much appreciated


Solution

  • It sure is possible.
    I suppose that your different 'items' are features of your app so you will not have to modify your Dockerfile as all your feature should work on the same environment.
    Depending of your infrastructure and if you are familiar/have some CI/CD tools you could automate the deployment per branch and so have all your feature version of the app running in different container.
    If you are not, you have to run your applications locally.
    So create a single Dockerfile which you put in all your branches then ask the dev to build and run the image on their branch then to verify that eveything is fine (you could automate some test to avoid manually doing this) before submitting a pull/merge request.