Lanes on another machine
The main branch of myapp moves onto a box: a machine that runs lanes of its own, which your machine mirrors under the same hostnames and port numbers. Here the box is devbox, a container you reach with Docker’s exec command. A VPS reached over SSH works the same way.
The box runs myapp
Section titled “The box runs myapp”devbox has devlanes installed, a Docker engine of its own and a clone of myapp on the main branch. Prepare a box has the steps.
$ devlanes start --no-uiLane 0 of myapp starts on the box, with its own Postgres container, at myapp.localhost and api.myapp.localhost.
You pair your machine once
Section titled “You pair your machine once”$ devlanes daemon pairThe box prints a one-time pairing code. By default it serves only machines that have paired with it.
On your machine, your user config gets one entry that says how to reach the box: a command that runs devlanes’ end of the connection inside the container.
remote: boxes: devbox: command: [docker, exec, -i, devbox, devlanes, tunnel, --stdio]remoteSettings for devlanes remote connect: boxes reached by a command, and how this machine serves clients when it is a box.
remote.boxesBoxes that devlanes remote connect <name> reaches by running a command instead of SSH, keyed by that name. Use it for a container, a WSL distribution or a codespace. Names not listed here are SSH destinations. Changes apply at the next remote connect.
remote.boxes.<name>A box that devlanes remote connect <name> reaches by running a command. The command must run devlanes tunnel --stdio in the box.
remote.boxes.<name>.commandThe program and its arguments as a list, one item per argument. No shell runs it. It must run devlanes tunnel --stdio in the box with its input and output passed through and no terminal, so use docker exec -i, not -it. It runs again for every reconnect and cannot ask for input, so sign in to its tool first.
$ devlanes remote connect devbox --background --code V7G3-AFH2Your daemon connects to the box and keeps the connection. It trades the code for a token, so later connections need no code. A box you reach over SSH needs no entry: devlanes remote connect takes the SSH destination.
You choose the box’s lane
Section titled “You choose the box’s lane”$ devlanes remote use devbox myapp@0From then on, the hostnames of myapp’s lane 0 lead to devbox. A lane on your own machine with the same hostnames keeps them until you choose the box’s lane this way.
The browser opens the box’s lane
Section titled “The browser opens the box’s lane”You open https://myapp.localhost in the browser on your machine. Your daemon answers it with a certificate from the devlanes CA, a certificate authority devlanes creates on your machine, and sends the request over the connection to the web app on the box. The box’s ports are mirrored on your machine under the same numbers, so a tool on your machine reaches them on 127.0.0.1 as well.
You start and stop the box’s lane in a shell on the box, and work with it from your machine as if it ran here.