Skip to content

Backgrounds

How-to Guides

Technical References

VIP Local Development Environment /

Advanced Topics

Domain Mapping

The VIP Development Environment tool will create environments with domain names with the following pattern <siteSlug>.vipdev.lndo.site.

Please refer to the following example where the environment domain is test.vipdev.lndo.site

$ dev-env create --slug test
This is a wizard to help you set up your local dev environment.

Sensible default values were pre-selected for convenience. You may also choose to create multiple environments with different settings using the --slug option.


✔ WordPress site title · VIP Dev
✔ Multisite (y/N) · false
✔ WordPress - Which version would you like · 5.8.1
✔ How would you like to source vip-go-mu-plugins · image
✔ How would you like to source site-code · image
 NAME        test                                                                                      
 LOCATION    /home/pavel/.local/share/vip/dev-environment/test                                         
 SERVICES    devtools, nginx, php, database, memcached, vip-search, wordpress, mu-plugins, client-code 
 NGINX URLS  http://test.vipdev.lndo.site/                                                             
             https://test.vipdev.lndo.site/                                                            
 STATUS      DOWN                                          

When http://test.vipdev.lndo.site/ is put into a browser. DNS resolution will find an A record for *.lndo.site that maps to a localhost. That request should then hit a traefik proxy container which is part of the Development Environment bound to the localhost 80.

Finally, traefik proxy container will use the full domain name to direct traffic to the correct nginx container in the internal docker network.

Port Binding

There are several containers/services that together compose dev-env. Some of these containers bind host ports to be accessible from outside of their internal network.

Proxy

As mentioned above traefik proxy container serves as a gateway to your environment. It will try to bind port 80 and 443 to support http and https traffic. If those ports are taken, backup ports will be used instead.

The proxy container is shared between all the Development Environments running on the host machine. Which is what enables the tool to run multiple dev-env instances under different domains at the same time.

Other Services

On a running Development Environment you can use info subcommand to see other exposed services, that have a port mapped to the host machine.

$ dev-env info --slug test
 NAME               test                                                                                     
 LOCATION           /home/pavel/.local/share/vip/dev-environment/test  
 SERVICES           devtools, nginx, php, database, memcached, phpmyadmin, vip-search, wordpress, mu-plugins, client-code 
 NGINX URLS         http://test.vipdev.lndo.site/      
                    https://test.vipdev.lndo.site/  
 PHPMYADMIN URLS    http://localhost:49170  
 DATABASE           127.0.0.1:49169 
 ENTERPRISE SEARCH  http://127.0.0.1:49168                                
 STATUS             UP               

In the example above those are phpmyadmin, database, enterprise search. These ports will be selected to not conflict with any other running environment and therefore might change between restarts of an environment.

Last updated: November 05, 2021