Looking for some guidance

I’m familiar with many of the Docker concepts and it seems like Rancher does a great job of simplifying many things. But I’m no expert, so I’m looking for some guidance on a project. I want to start it using Rancher.

My project will be a PHP/Nginx/MySQL system, using Redis caching. Might add more pieces later. I have an external DB setup in AWS right now, so I don’t need help with that.

My main question is how do I properly handle my code files? Both the PHP container and Nginx will need access to my code base. Is it more common to package my code into each of those image to bring into Rancher? Or is it a better practice to create a data container that holds my code and then just try to use the “volumes_from” on the source code container? Or is there a better way still? I’d like to avoid needing to update multiple images when I make code changes, so it seems like the data container would be better, but I’m not sure what the best practices are there.

Anyone have any suggestions for setting up a workflow I’m looking for? Eventually I’d like to setup CI/CD with the whole setup, but I’m just trying to take it one step at a time.

From the little bit I have read, it seems like Gitlab + Jenkins, or Gogs + Drone would be a good route to go for CI/CD.

Do note that there is a Rancher project in the works for a CI/CD pipeline, though I do not know when it will be released. Likely, some time after 2.x reaches GA.

Hopefully someone else with more experience can comment with more details on actual implementation.

Yes, GitLab has the pipelines feature, so I will be looking into that.

I’m more curious about best practices for setting up my docker containers. Whether or not to use a data container for code, or just bake into the PHP/Nginx containers sepearately, etc.