0

I want to create/host multiple applications on 1 server. This will happen through docker-compose. This docker-compose has 3 instances: web, db and nginx.

So each application will start from a docker-compose up command.

The question I still have is: do I need the nxinx inside the docker-compose config, or should I create 1 nginx config?

Why this question? I want to run a single command to run 1 application, instead of running a command and alter the nginx config over and over again.

Can someone help me please? Thanks in advance!

2
  • Do you want to start only those 3 services, or more projects? Commented Nov 19, 2020 at 9:30
  • For each project, I want to start those 3 services. Commented Nov 19, 2020 at 9:32

1 Answer 1

1

What you can do is expose the service (web) for each project in the host on a different port and have a central nginx docker container - or an nginx installation that would define the reverse proxying for each application.

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

4 Comments

Having a central nginx docker will result in me having to change this config for each application I run?
You need a way to update its configuration on each deployment for it to route properly. Otherwise you need a container orchestration platform like kubernetes.
That's what I thought. So it's not possible that each application that I run has it's own nginx config? This config will always be the same, except for the port.
Well, you can do that but you can only have one nginx listening on each port (eg 80/443), thats the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.