Choose what a box shares
A connected machine mirrors each service and container that the box’s lanes run, and you can keep some of them on the box or add a server you run there yourself. Environments, secrets and logs stay on the box either way, as Remote mirroring explains.
::example{slug="remote-docker-box"}
Put these lines in the project file on the box, or in the local file next to it when only your box needs them.
Keep a service on the box
Section titled “Keep a service on the box”Mark the service as hidden with services.<name>.hidden. Machines that connect never see it, and it runs on the box as before.
# devlanes.local.yaml on the boxservices: admin: hidden: trueservicesLong-running processes of each lane, started together after infrastructure, setup and lane.start tasks. Each service gets its own port as PORT and, with hosts, HTTPS hostnames. A service that exits shows as failed and is not restarted.
services.<name>A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane's block (PORT, ${{ self.port }}); devlanes stops it with the lane and never restarts it when it exits. A service needs run or run_script, directly or through extends.
services.<name>.hiddenKeep this service away from machines connected with devlanes remote connect. They never see, mirror or reach it, and do not get its sync folders. It still runs on this machine. Defaults to false.
A running service keeps the setting it started with, so restart it on the box.
$ devlanes restart adminKeep a container on the box
Section titled “Keep a container on the box”List the containers by name under infra.hidden.
infra: hidden: [postgres]infraContainers the lanes depend on (databases, brokers, object stores), started and waited on before setup, tasks and services, plus the commands that create and remove each lane's data in them.
Config referenceinfra.hiddenContainers that machines connected with devlanes remote connect never see, mirror or reach.
Mirror a server devlanes does not run
Section titled “Mirror a server devlanes does not run”A server you start on the box yourself is reachable from your machine once the box’s config declares its address and hostname. Your machine mirrors it while a lane of the project runs on the box. Pick a port outside the box’s port range.
# devlanes.local.yaml on the boxinfra: external: files: address: 127.0.0.1:8000 hosts: "files.${{ lane.domain }}"infraContainers the lanes depend on (databases, brokers, object stores), started and waited on before setup, tasks and services, plus the commands that create and remove each lane's data in them.
Config referenceinfra.externalServers you run yourself on a loopback port, such as pgAdmin, keyed by name. Every lane lists them, the proxy routes their hostnames, and machines connected with devlanes remote connect mirror them while a lane of the project runs. devlanes never starts or checks them. Put personal ones in devlanes.local.yaml.
infra.external.<name>A server you run yourself on a loopback port. Every lane of the project lists it, the proxy routes its hostnames to the port, and machines connected with devlanes remote connect mirror it while a lane of the project runs. The port is the same in every lane.
infra.external.<name>.addressWhere the server listens, 127.0.0.1:<port> or [::1]:<port>. Only loopback addresses work. A port that devlanes or a lane already uses is an error. Required.
infra.external.<name>.hostsHostnames the devlanes HTTPS proxy routes to the port. One entry or a list. An entry is a hostname, or a mapping with host and optional fallback and host_header. Expressions can use lane, project, infra and env. Put the names under ${{ lane.domain }} so each lane gets its own. The first host without a wildcard becomes the unit's URL.
Give a server you run yourself a hostname covers the entry. To declare one and still keep it on the box, set infra.external.<name>.hidden.