From a8a45631c2f581337fafc0552a13bf4144450e82 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Fri, 8 Dec 2023 03:40:51 -0800 Subject: [PATCH] Browser: update the documentation - large #247 improvement (@stevenlafl) --- docker-compose.yaml | 4 +++ docs/config-browse.md | 4 +++ docs/docker/docker-compose-browserless.yaml | 31 +++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 docs/docker/docker-compose-browserless.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml index cdb7d3f9d..ca98c5269 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,7 @@ +# Very simple docker-compose file to run the app on http://localhost:3000 (or http://127.0.0.1:3000). +# +# For more examples, such runnin big-AGI alongside a web browsing service, see the `docs/docker` folder. + version: '3.9' services: diff --git a/docs/config-browse.md b/docs/config-browse.md index e8c36c1e3..ac5f4e852 100644 --- a/docs/config-browse.md +++ b/docs/config-browse.md @@ -50,6 +50,10 @@ Now you can use the following connection string in `big-AGI`: `ws://127.0.0.1:92 You can also browse to [http://127.0.0.1:9222](http://127.0.0.1:9222) to see the Browserless debug viewer and configure some options. +Note: if you are using `docker-compose`, please see the +[docker/docker-compose-browserless.yaml](docker/docker-compose-browserless.yaml) file for an example +on how to run `big-AGI` and Browserless simultaneously in a single application. + ### 🌐 Your own Chrome browser ***EXPERIMENTAL - UNTESTED*** - You can use your own Chrome browser as a browsing service, by configuring it to expose diff --git a/docs/docker/docker-compose-browserless.yaml b/docs/docker/docker-compose-browserless.yaml new file mode 100644 index 000000000..5c4ac9acb --- /dev/null +++ b/docs/docker/docker-compose-browserless.yaml @@ -0,0 +1,31 @@ +# This file is used to run `big-AGI` and `browserless` with Docker Compose. +# +# The two containers are linked together and `big-AGI` is configured to use `browserless` +# as its Puppeteer endpoint (from the containers intranet, it is available browserless:3000). +# +# From your host, you can access big-AGI on http://127.0.0.1:3000 and browserless on http://127.0.0.1:9222. +# +# To start the containers, run: +# docker-compose -f docs/docker/docker-compose-browserless.yaml up + +version: '3.9' + +services: + big-agi: + image: ghcr.io/enricoros/big-agi:main + ports: + - "3000:3000" + env_file: + - .env + environment: + - PUPPETEER_WSS_ENDPOINT=ws://browserless:3000 + command: [ "next", "start", "-p", "3000" ] + depends_on: + - browserless + + browserless: + image: browserless/chrome:latest + ports: + - "9222:3000" # Map host's port 9222 to container's port 3000 + environment: + - MAX_CONCURRENT_SESSIONS=10 \ No newline at end of file