M
M
mcrack2020-10-28 15:05:42
Docker
mcrack, 2020-10-28 15:05:42

Docker how to add a domain?

Hello, in general, I have a docker-compose.yaml file, a web server, mysql server and adminer are configured in it, it's all one project.

I want to install this project on my corporate server and assign each project its own local domain name, for example, I will have this: name-project1.local, adminer.name-project1.local, mysql.name-project1.local.

In order not to enter by port, but by a full-fledged domain name.

On the router, I configured dns in such a way that when I go to the name-project1.local domain and others, I would be redirected to the ip address of the server where Docker is installed.

So, earlier, when the server had OpenServer, you could specify a domain and that's it, but now you need to do something there, either with nginx-proxy roofing felts or with networks, again, it’s not clear exactly how to set it up.

Tell me a simple option of how and with what commands to do it all, if possible it would be convenient if it was a ready-made docker-compose.yaml file, I don’t understand how, there are a lot of things, but nowhere is it exactly written like this do.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SlavikF, 2020-10-28
@mcrack

The nginx-proxy container is written exactly for this task:
https://github.com/nginx-proxy/nginx-proxy
This "nginx-proxy" monitors which containers are running on the system, and when new containers appear, it automatically adds them to your proxy.

I
Ivan Shumov, 2020-10-28
@inoise

The simplest is really to install nginx and distribute traffic to containers from it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question