Few questions how to use Docker with regarding to web apps (Multiple WordPress, NextCloud, VPN etc.)

Hi! My name is Kimberley and I’m new here :blush: (is there anywhere a introduction fora?)

In recent weeks I have started with 2 Raspberry Pi4s and I am very happy with them. What I wanted to achieve is my own apache server with different websites and I succeeded! By making a lot of mistakes and especially starting over a lot and I really mean going through all the steps from the beginning.

Then a friend came up with the tip to try Docker, so I set to work on that. Again it took me hours or even days with a lot of high blood pressure and stress, what a lot it takes to understand that! Respect for everyone who thinks this is a piece of cake! Finally learned a lot, but now I also got a lot of questions, see below;

1.a) Have a Docker container containing Biarms / Mysql, Wordpress and PHPMyAdmin. On my first Raspberry everything runs without a container and because it has several websites running on it, I had to point domain names to the correct folder in file /etc/apache2/sites-available/000-default.conf. But how is that going with Docker container websites? Where do I indicate which domain should go to which Docker container?

1.b) Is it smarter to create a new Docker container per website or is it smarter to host all websites in 1 Docker container?

  1. Now have a NextCloud with Biarms / MySQL running in Docker container, just wondering if I can view the files without opening the Docker container. Where are they stored and can I possibly ensure that they are stored outside the Docker container? (Wordpress files can be viewed and edited outside the container, exactly what I would like with NextCloud)

  2. Is it smart to place different images in 1 Docker container or do you have to grab one Docker container per images? What is Wisdom?

What I ultimately want is my own VPN, cloud storage or NAS, web server with different websites and preferably with a control panel for the websites to be configured. What is the logical structure in Docker here?

Can’t find an answer to the question 1.b) is running individual container smarter than creating docker-compose.yml with serveral images (do I said that correct?) Like this: (I’m working with VSCode)

v CONTAINERS 
  v wordpress site one
     v mysql
     v phpmyadmin
     v wordpress
  v wordpress site two
     v mysql
     v phpmyadmin
     v wordpress
  v wordpress site three
     v mysql
     v phpmyadmin
     v wordpress
  v nextcloud
     v mysql
     v nextcloud

or should I work with individual containers?

v CONTAINERS
   v apache2
   v mysql
   v php7
   v phppmyadmin
   v wordpress site one
   v wordpress site two
   v wordpress site three
   v nextcloud

or doesn’t matters at all?

The thing about Persistent data, is it correct when I say that the data is not accessible via Rasp OS, but can be reached in all kinds of ways and therefore more secure?

The layout pretty much depends on your needs and the ressources at hand.

The suggestion is to use a reverse proxy as entrypoint and use fpm versions of the image to save ressources. I would definitly go with a distinct container per site, as the intances won’t be tightly coupled.

Though, you might want to stick with a single mysql instance and use a different database per site container.

May I suggest this exceptional free self-paced docker training? Introduction to Containers . The number of slides might seem a lot, but many of them can be rushed thru - they are definitly worh the time!. Make sure to do the hands-on exercises.