lando / lagoon

The Official Lagoon Lando Plugin
https://docs.lando.dev/lagoon
GNU General Public License v3.0
3 stars 4 forks source link

Allow proxy service to handle primary server other than Nginx #45

Closed CGoodwin90 closed 1 year ago

CGoodwin90 commented 1 year ago

Updated the proxy service to be able to assign primary routes to services other than Nginx.

The primary server can be defined in .lando.yml:

name: lando-services
recipe: lagoon
services:
  node:
    command: yarn run start
    primary: true
  ruby:
    command: ruby -run -e httpd / -p 3000
    port: 3000
    primary: false
  python:
    command: python -m http.server 8800
    port: 8800
    primary: false

If the primary server is not defined, it will fallback to a priority list of other services - nginx, node etc.

netlify[bot] commented 1 year ago

Deploy request for lando-lagoon accepted.

Name Link
Latest commit f191dbb49988f2bcee9bba54cc852bf0d8826e7f
Latest deploy log https://app.netlify.com/sites/lando-lagoon/deploys/64fab3b37497ec0007948ddb
pirog commented 1 year ago

@CGoodwin90 does lagoon have a concept of "primary service"? if so where does that live in the config? Can we not just use that concept and map it over to Lando?

If not, In Lando 4 we are going to use the following to indicate the "primary" service. it might be worth adopting this convention in the lagoon plugin logic so its easier when we move everything to use the new lando 4 services api.

landofile

services:
  service1:
    primary: false
  service2:
    primary: true
  ...
  serviceN:
CGoodwin90 commented 1 year ago

Thanks @pirog - I've updated this now to match the logic in Lando 4