How to run docker on dedicated debian12 server as a service for apache2 vhosts?

I have a dedicated server which is used for serving several domains on the net. To be able to upgrade some instances (CMS) within specific apache2 Vhosts. Need to have a newer version of mysql available (now mainly 5.7). So want to run that in a docker container making it accessible for the cms in the vhost.
Seems all straight forward, reading the instructions. Though, have some questions before making the move..

  • can docker run aside all existing other services which are already on the server? So it is not disturbing anything? Since it is a production server hosting several sites and a mail-server. (I have backups so can restore the server if things go wrong). But better be prepared.

  • how to get into the new mysql container? I use one instance of phpmyadmin already on the server. Can I have that instance also for maintaining the containers mysql db? Or do I need to run a phpmayadmin instance in the same container or an own container? How to approach all avoiding making things complex?

  • also want to be able to remotely create and maintain the containers/ docker. Is there a recommended GUI to use (which is also secure). Could that be Portainer? Or recommend an other GUI?

That’s the great thing about containers: they are isolated. The only usual conflict is when publishing ports from the container to the host, when the port is already used.

Docker has a feature called Docker networks. You create a virtual Docker network, attach containers to it, those can interact with each other. You would run phpmyadmin in another container.

There are a bunch of GUIs available, like Portainer and Dockge.

My usual approach is to have a reverse proxy (traefik, nginx) publish ports 80 and 443 on host and handle TLS, connected to a “proxy” network". My app containers are connected to the “proxy” network" and to the “database” network. Database is only connected to “database” network. Traefik and nginx-proxy can even enable auto-configuration of target services via labels or env vars, no messing with proxy config files.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.