2

On SO there was a good answer https://stackoverflow.com/questions/47849096/running-multiple-websites-docker-compose, 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...

What I want to achieve is:

  1. Keep possibility to clone one website and run it locally \ for development
  2. Have possibility to run all websites in "one-click" in production
  3. Have possibility to run something in a "shared" container (like nginx reversproxy for routing and handling HTTPS; also it could be containerized SMTP server for sending emails) in production

0

You must log in to answer this question.

Browse other questions tagged .