diff --git a/documents/resources/web-instance.md b/documents/resources/web-instance.md new file mode 100644 index 0000000..7d676ea --- /dev/null +++ b/documents/resources/web-instance.md @@ -0,0 +1,65 @@ +Hosting your own LBRY Web Instance +---- + +## Preparing the SDK +### Building your own image + +Create a config.yaml file and modify as you need. This is a good start: +``` +allowed_origin: "*" +max_key_fee: "0.0 USD" +save_files: false +save_blobs: false +streaming_server: "0.0.0.0:5280" +api: "0.0.0.0:5279" +data_dir: /tmp +download_dir: /tmp +wallet_dir: /tmp +``` + +Note that it is required to have `streaming_server` and `api` set to public IPs. Or at least the same network where the app will be served. + +Now move the config file to `docker/webconf.yaml` and run: +``` +docker build -f docker/Dockerfile.web -t / . +docker push +``` + + +### Using pre-built docker image + +TODO: use official images + +This image comes with `save_blobs` and `save_files` to `false`, so it won't use disk. +``` +docker run -d -p :5279 -p :5280 vshyba/websdk +``` + +## Webapp + +Clone and install the app as described in the [lbry-desktop repo README](https://github.com/lbryio/lbry-desktop). +If you want to customize it further, follow the extra steps in `Customize the web app` section. Otherwise: +``` +git clone https://github.com/lbryio/lbry-desktop.git +yarn +cp .env.defaults .env +``` + +Configure .env as you need. This is a sample: +``` +SDK_API_PATH=http://:/ +... +WEB_SERVER_PORT= +LBRY_API_URL=http://disabled-api/ +LBRY_WEB_API=http://: +LBRY_WEB_STREAMING_API=http://: +LBRY_WEB_BUFFER_API=https://disabled +... +customize UI and other values as needed +``` + +Compile and run: +``` +NODE_ENV=production yarnpkg compile:web +nodejs web/index.js +```