I don't know whether the source of vscode.dev is available anywhere, but have a look at openvscode-server, which does almost exactly the same:
https://github.com/gitpod-io/openvscode-server