Skip to content

Networking

The VIP Local Development Environment is composed of several Docker containers. Some of these containers bind host ports to be accessible from outside of their internal network.

The traefik proxy container is shared between all local environment’s running on the host machine. This makes it possible to run multiple dev-env instances simultaneously under different domains.

Unique domain names are created for each local environment with the following pattern:
<site-slug>.vipdev.lndo.site

The traefik proxy container uses the full domain name to direct traffic to the correct NGINX container in the internal Docker network.

For example, when a local environment’s domain http://test.vipdev.lndo.site/ is loaded in a browser, DNS resolution will find an A record for *.lndo.site that maps to a localhost. That request will then hit the traefik proxy container which is bound to the localhost port 80.

The traefik proxy container serves as a gateway to the local environment, and 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.

Port binding for services

Use the info subcommand to see other exposed services on a running VIP Local Development Environment that have a port mapped to the host machine.

vip dev-env info

In the following example output, the exposed services for the local environment with the slug test are PHPMYADMIN and ENTERPRISE SEARCH.

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

The ports for these services are explicitly selected to avoid conflicting with any other running environment. For this reason, service ports might change between restarts of an environment.

Last updated: December 22, 2023

Relevant to

  • WordPress