Skip to content

devlanes is in beta and not ready for production use.Report an issue

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.

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.

on the box
$ devlanes start --no-ui

Lane 0 of myapp starts on the box, with its own Postgres container, at myapp.localhost and api.myapp.localhost.

on the box
$ devlanes daemon pair

The 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.

~/.devlanes/config.yaml
remote:
boxes:
devbox:
command: [docker, exec, -i, devbox, devlanes, tunnel, --stdio]
~/dev/myapp
$ devlanes remote connect devbox --background --code V7G3-AFH2

Your 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.

~/dev/myapp
$ devlanes remote use devbox myapp@0

From 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.

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.

Your machinedevbox, the boxone connectionBrowserhttps://myapp.localhostdevlanes daemondevlanes daemonmyapp lane 0: web

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.