Dockerize CRM php/mysql/apache

Jan 25, 2026 - 7:55 PM

https://megagrass.com/community/question-and-answer/forums/4133/topics/3101880 COPY
  • Hi I am new to this community and I am trying to dockerize a management app. This app is developed in php/mysql and is currently running on apache2.
    The management app needs some things such as curl, ssh, ssl (let’s encrypt)…
    In your opinion is what image should I start from? A linux distribution, for example an image of UBUNTU SERVER?

    0
  • When using docker, you want to split it up as much as possible, so 1 image containing all services, mysql, php, ssl, is generally a no-go.

    0
  • I’d just grab the official PHP-Apache image and layer in what you need with a Dockerfile, then run MySQL as its own container so you can tweak each part without breaking the whole setup. Adding certbot in a small sidecar works fine for Let’s Encrypt. I’ve seen setups like acupowererp.com use a similar split approach, which keeps things cleaner and easier to update without headaches.

    0
  • Good advice above especially splitting services instead of putting everything into one container.

    For a PHP/MySQL/Apache CRM, a clean starting point is usually:

    • php:apache (or php:fpm + nginx) for the app
    • mysql as a separate container
    • a reverse proxy container (nginx/traefik) for SSL and routing
    • certbot (or built-in Traefik/NGINX automation) for Let’s Encrypt

    That setup is easier to maintain, debug, and scale later. Starting from a full Ubuntu image usually makes the container heavier than necessary and harder to manage long term.

    Also, if this CRM is expected to grow and collect a lot of operational data, it’s worth thinking ahead about analytics architecture too (not just app containers). Planning storage/ETL early can save a lot of rework later, something like data lake consulting can be useful when the project moves beyond the first deployment.

    0