daml/web-ide/proxy
Bolek@DigitalAsset 63960bfa85
webide: failing terminal (#1087)
* fail bash terminal by setting config to run bogus command
* one last fix for hiding terminal

Initially attempted to use external terminal with echo command but this
still opened an integrated terminal. Changing the terminal command from
/bin/bash to echo "No Terminal Available" crashes the integrated
terminal, which of course is better than having a working terminal!
2019-05-10 15:31:32 -04:00
..
src web ide: security headers (#1063) 2019-05-10 11:43:18 -04:00
static webide: failing terminal (#1087) 2019-05-10 15:31:32 -04:00
Dockerfile webide: remove trademark images and phrases (#711) 2019-04-29 22:56:17 -04:00
package-lock.json webide: remove trademark images and phrases (#711) 2019-04-29 22:56:17 -04:00
package.json webide: remove trademark images and phrases (#711) 2019-04-29 22:56:17 -04:00
README.md web-ide: clean up / refactor (#421) 2019-04-12 15:01:55 +00:00
tsconfig.json web-ide: clean up / refactor (#421) 2019-04-12 15:01:55 +00:00

DAML WEB IDE proxy

This proxies the docker hosted web ide. It spins up a docker instance for each user and forwards http and websocket connections. Session state is managed by cookie (webide.connect.sid by default)

Running

For quick developement cycles we can disable some cumbersome security features; create a copy of src/config.json as src/config.local.json and remove docker.hostConfig.NetworkMode entry.

cd web-ide/proxy
npm install
npm run compile && npm run local-start

When running on server, the proxy creates containers on an internal network "web-int". In order for the proxy to communicate with them it must run under docker attached to two networks, "web-int" and "web-ext". The network creation and attachment happen automatically but it simply means that in order to run the proxy locally the same way it runs on server you have to run it via docker image and mount docker.sock.

download the proxy and webide images from dockerhub

docker pull digitalasset/daml-webide-proxy:0.11.19-master
docker pull digitalasset/daml-webide:0.11.19-master

then run it

docker run --rm -it -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock ${IMAGE_ID_OF_PROXY}

Building image

docker build --rm -t digitalasset/daml-webide-proxy:0.11.19-master web-ide/proxy/

Container settings

The proxy uses dockerode to manage docker containers, which is a small library over the rest based docker API. Most settings can be configured from config.json hostConfig entry. See API details HostConfig entry