That works, but if you work with 3 or more sites it starts to get confusing.
Is there a quick way to assign domain names instead of localhost:port via docker-compose.yml?
Perhaps by using a local IP address which then can be mapped via the hosts file.
...
PHP_SITENAME: mysite.com
...
NGINX_SERVER_NAME mysite.com
...
then add to your hosts
127.0.0.1 mysite.com
But you still have to use port forvarding and access site by mysite.com:8000 because 80 ports is already taken by another process (by docker, as I understand).
And use PHP_SITENAME because there is typo in source files for the corresponding image.
And use PHP_SITENAME because there is typo in source files for the corresponding image.
By the way, this issue has been fixed in #43.
Can't we have one more nginx container that will act as a proxy in a separate project.
In the proxy configs, you will bind the domain:port mappings, using base ports ranges for name-spacing.
Proxy will work on port 80 and 443 (for SSL).
Like so:
Project 1 -> 7XXX ports, project 2 -> 8XXX and so on.
In the proxy you have:
mysyte1.local goes to localhost:7XXX
mysyte2.local goes to localhost:8XXX
.. And so on.
When starting new project:
@ndobromirov's idea sounds good.
If this is implemented it would make it possible to run sites utilizing the Domain Access module (https://www.drupal.org/project/domain) locally (we need it for our most important site).
Also, it would also be a solution for #21.
I am currently using jwilder/nginx-proxy container to get name resolving but Pavel has already said something about using containous/traefik in #50
@macmladen can you elaborate on how you are using nginx-proxy a bit (e.g. give some sample configs) ... I've been trying to get this working for a bit without success. This workaround seems promising but having some examples would be great!!
You can now use docker4drupal with domains https://docs.wodby.com/stacks/drupal/local/#domains
Most helpful comment
You can now use docker4drupal with domains https://docs.wodby.com/stacks/drupal/local/#domains