DEV Community

Om Prakash Tiwari
Om Prakash Tiwari

Posted on

Develop your code online using vscode-tunnel

Introduction

It has been a great hastle to work in teams on same project without having a good infrastructure. It has been observed that we (frontend/backend developers) generate multiple versions of code on different machines and sometimes older code is pushed again on the repository breaking some changes causing bugs in some running component/feature. While development on a "on premise development server" becomes a great hastle and difficult to mange. The Production server cannot have option to install a test version of the code and share to developers due to security issues.

VS Code has came with a feature called remote development and has introduced vscode-tunnel to allow developers share code between machnines. This is very helpful if we are working in the same network with single github account or taking paid plans from microsoft to manage multiple accounts in the same tunnel.

While working on this issue, we have developed a docker image to create vscode tunnel using a single line of code.

How to use

# Replace /path/to/sourcecode to path as in your computer
docker run -d -v /path/to/sourcecode:/home/node/workspace --name vscode-tunnel-server optiwariindia/vscode-tunnel
Enter fullscreen mode Exit fullscreen mode
  • After starting this container open Logs for the container using command below:
  docker logs vscode-tunnel-server
Enter fullscreen mode Exit fullscreen mode

This will return some instructions that you can follow to connect it with your github account.

  • To access the code open vscode.dev and select "Connect to tunnel" button and follow instructions.
  • Once connected to tunnel, click on "Open folder" and select your workspace work.

Top comments (0)