0

I want to run multiple containerized web apps behind a containerized reverse proxy. I am using nginx-proxy as a reverse proxy and letsencrypt-nginx-proxy-companion for creation, renewal, and use of Let's Encrypt certificates.

Each of the web apps has a set of dependencies (containers themself) and could be managed by one docker-compose file. However, currently, reverse proxy service, certificate service, and all web apps are in the same compose file. I just run docker-compose up -d and all my web apps are running.

As you see I am using docker-compose to set up my whole server infrastructure by just running one command. However, it feels a bit like I am misusing or even abusing docker-compose since I am bundling independent applications together.

Is it ok to bundle multiple containers, which do not belong together, in one docker-compose for convenience, or is there a better way to set up everything with one command?

1 Answer 1

1

I think that it's totally fine and this is the purpose of docker-compose.

If you do wish kind of separation you can always split a group of containers into a separate docker-compose and run whatever you need in a single command.

For example, if you split into to groups, and name the first file as docker-comopose-app-a.yaml and docker-compose-app-b.yaml you can run them together with:

docker-compose -f docker-comopose-app-a.yaml -f docker-comopose-app-b.yaml up

EDIT:

You can also see the outcome before running them by changing up with config - it will print the concatenate docker-compose to stdout and detect errors if there are any.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.