Answer the question
In order to leave comments, you need to log in
If I want to keep two projects of the same type on the same server, can I use existing containers?
I now have one project deployed on VPS (there are nginx, php, mysql in the docker). I want to throw another project on this VPS, can I use the same containers that I already have if I need the same tools (mysql, nginx, php).
I just don’t quite understand, for my last project I have a docker-compose file, which just describes all these tools, there are also mysql creds with the necessary database. Do I now need to make a folder with a new project and create the same docker-compose there only with other mysql creds (and another database)?
Interested in whether I should have 3 containers active in docker ps, or 6 (php for the previous project, php for the new project, nginx for the past, nginx for the new, mysql for the old, mysql for the new)?
Answer the question
In order to leave comments, you need to log in
Depending on how everything is set up, for example, according to the "true bang" your database files are not in the docker container, but outside, what will happen when two database containers work with the same database folder? The second is ports, how can they resolve conflicts? But on the other hand, after you, who decides to update php on one project without knowing that another project is running on the same container? According to recommendations, different projects use their own sets of containers and folders for storing files (DB, sessions, logs), and one balancer on port 80 (nginx) can separate them. But for a quick option, no one bothers you to use one set of containers and, again, send one nginx to the right directory, the database stores both projects accordingly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question