1

This Running multiple websites - docker compose is a good answer, but it works only when you have structure like

└───project
    │   docker-compose.yml
    │
    ├───reverseproxy
    │       Dockerfile
    │       nginx.conf
    │
    ├───website1.com
    │       Dockerfile
    │
    └───website2
            Dockerfile

(of course there is some other stuff except mentioned, but that's the most important ones)

But I think that usually structure is different (at least it both makes sense for me and I use it currently):

└───projects
    ├───website1.com
    │       docker-compose.yml
    │       Dockerfile
    │
    ├───website2
    │       docker-compose.yml
    │       Dockerfile
    │
    └───website3
            docker-compose.yml
            Dockerfile

Each of "website" folders is a separated git repo. Each website can be cloned by itself and run locally. So for website1.com development you don't need to clone all other 100 websites hosted on the same server.

And here is the question - having this structure (which is good for local testing\development) how do I "combine"/"merge" all websites in production server? Looks like inheritance would be most suitable here, but there is reported issue for docker-compose which makes it almost useless without ugly workarounds...

The Godfather
  • 4,235
  • 4
  • 39
  • 61
  • I'd just run `docker-compose up` in each repository, and if it's more than a couple, look into some more industrial infrastructure. What issue are you running into? – David Maze Aug 18 '18 at 17:13
  • As you saw I have "reverseproxy" container in the first scheme. But it's not on the second. And it has to know the ports of each of website container to manage the redirects. And I want something like "one-click deploy" and not going manually (or writing bash script) to each dir and runnning compose. – The Godfather Aug 18 '18 at 17:24
  • And it seems like one of the most *basic* tasks you may want to do. And the tool has no capability to do this properly??? And no one in the world is doing that? I cannot believe :) – The Godfather Aug 18 '18 at 17:28
  • It does sound like you're looking for "more industrial infrastructure"; for instance, Kubernetes has a better-defined network model, a declarative resource specification, support for rolling updates of individual containers, and an abstract model for defining the sort of reverse proxy you're looking for. Docker Compose is a good tool for small jobs but it sounds like you have a bigger one. – David Maze Aug 18 '18 at 17:46
  • I just have 4 websites hosted on my VPS server and I want one-click deploy... Does it sound like "industrial"? – The Godfather Aug 18 '18 at 18:08
  • Any elegant solution for this? @TheGodfather – Diogo Silva Nov 09 '21 at 22:42

0 Answers0