ironstar-io / tokaido

Zero-conf Drupal Local Development Environments with Docker
https://tokaido.io
BSD 3-Clause "New" or "Revised" License
57 stars 10 forks source link

Feature/hot reload proxy #199

Closed ironmike-au closed 5 years ago

ironmike-au commented 5 years ago

This PR enables hot-reloading of nginx config files in the proxy service (ie: *.local.tokaido.io).

It does this by flipping the network membership logic around. Instead of every project network being added to the proxy container, instead, the proxy network is added to every haproxy instance.

This change means we don't need to restart the 'proxy' container; We can simply send a HUP signal to nginx in the running proxy container to tell it to read new config with each tok up.

This nearly halves startup time on my system, down from about 36 seconds to 20 seconds! 😃

It also greatly simplifies the complexity of the proxy container, and that should hopefully make things more stable.