Fixes to enable dockerized khoj to operate its computer

This commit is contained in:
Debanjum
2025-06-01 19:19:01 -07:00
parent f95d352eb9
commit a236288ca9
4 changed files with 6 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ RUN apt update -y && apt -y install \
libgl1 \ libgl1 \
libglx-mesa0 \ libglx-mesa0 \
libglib2.0-0 \ libglib2.0-0 \
docker.io \
# Required by llama-cpp-python pre-built wheels. See #1628 # Required by llama-cpp-python pre-built wheels. See #1628
musl-dev && \ musl-dev && \
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 && \ ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 && \

View File

@@ -28,6 +28,7 @@ services:
# Creates Computer for Khoj to use. # Creates Computer for Khoj to use.
# Set KHOJ_OPERATOR_ENABLED=True in the server service environment variable to enable. # Set KHOJ_OPERATOR_ENABLED=True in the server service environment variable to enable.
computer: computer:
container_name: khoj-computer
image: ghcr.io/khoj-ai/khoj-computer:latest image: ghcr.io/khoj-ai/khoj-computer:latest
ports: ports:
- "5900:5900" - "5900:5900"
@@ -55,6 +56,8 @@ services:
- khoj_config:/root/.khoj/ - khoj_config:/root/.khoj/
- khoj_models:/root/.cache/torch/sentence_transformers - khoj_models:/root/.cache/torch/sentence_transformers
- khoj_models:/root/.cache/huggingface - khoj_models:/root/.cache/huggingface
# uncomment line below to mount docker socket to allow khoj to use its computer.
# - /var/run/docker.sock:/var/run/docker.sock
# Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/ # Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/
environment: environment:
- POSTGRES_DB=postgres - POSTGRES_DB=postgres

View File

@@ -113,8 +113,6 @@ prod = [
] ]
local = [ local = [
"pgserver == 0.1.4", "pgserver == 0.1.4",
"playwright >= 1.49.0",
"pyautogui == 0.9.54",
] ]
dev = [ dev = [
"khoj[prod,local]", "khoj[prod,local]",

View File

@@ -16,9 +16,10 @@ Give Khoj its own computer to operate in a transparent, controlled manner. Accom
wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml
``` ```
2. Configure environment variables in `docker-compose.yml` 2. Update the `docker-compose.yml` to enable computer operator
- Set `ANTHROPIC_API_KEY` to your [Anthropic API key](https://console.anthropic.com/settings/keys) - Set `ANTHROPIC_API_KEY` to your [Anthropic API key](https://console.anthropic.com/settings/keys)
- Uncomment `KHOJ_OPERATOR_ENABLED=True` to enable the operator tool - Uncomment `KHOJ_OPERATOR_ENABLED=True` to enable the operator tool
- Uncomment `- /var/run/docker.sock:/var/run/docker.sock` to mount docker socket to allow khoj to operate its computer container.
3. Start Khoj services 3. Start Khoj services
```shell ```shell