I've got a web server set up for my robotics team that runs a LAMP stack alongside CPanel. It's really convenient for managing different websites, databases, and all that jazz. Recently, I've started working on a project with an ASP.NET Core backend that's squeezed in there, and it's set up so that Apache directs requests to it. Adding to the complexity, we've got more projects in the pipeline that involve node.js and Python backends, which is getting kind of chaotic.
I've played around with Docker at home for simple projects, and I'm interested in containerizing my server. However, I'm unsure how to handle my existing PHP websites with this transition. Here are some of my queries:
* Should each site have its own container?
* Can I use one PHP docker container for all my PHP sites?
* For my C# and Angular app, should the backend and frontend run in the same container or should I separate them?
* Is switching from LAMP/CPanel to a containerized setup a smart move?
2 Answers
When working with Docker, it's generally a good idea to have one container handle one process. So in your case, you'd want separate containers for the frontend and backend of your applications. For all your PHP sites, you could get away with a single PHP container, especially if you configure it properly to use virtual hosts in Apache or nginx.
Regarding whether to switch from CPanel to Docker, it really depends on how important easy management is for your team. CPanel provides user-friendly tools for site management, which you'll miss once you move to Docker. You didn't mention what specific CPanel features you rely on, so it's hard to say definitively if this switch is suitable for you.
As a trial, consider setting up a basic demo in Docker with your current structure but just dummy pages. This way, you can see if Docker fits your needs without moving over all your data initially.
It’s pretty common to think of containers as being like a lightweight virtual machine. You can technically run multiple processes in one container, but often it's clearer and easier to manage if you separate functionalities into different containers. However, don't stress too much about it; focus on what makes sense for your specific setup.
Thanks for the insight! I’ve been reading about how to set up CI/CD pipelines, and I think using Docker could definitely help with that for our projects.