mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Try pre-install deps, use custom launch.json for dev container
Previous attempts have not been sufficient. Let's see if this works
This commit is contained in:
@@ -10,9 +10,9 @@ WORKDIR /workspace
|
||||
|
||||
# --- Python Server App Dependencies ---
|
||||
# Create Python virtual environment
|
||||
RUN python3 -m venv .venv
|
||||
RUN python3 -m venv /opt/venv
|
||||
# Add venv to PATH for subsequent RUN commands and for the container environment
|
||||
ENV PATH="/workspace/.venv/bin:${PATH}"
|
||||
ENV PATH="/opt/venv/bin:${PATH}"
|
||||
|
||||
# Copy files required for Python dependency installation.
|
||||
COPY pyproject.toml README.md ./
|
||||
@@ -30,11 +30,11 @@ RUN sed -i "s/dynamic = \\[\"version\"\\]/version = \"$VERSION\"/" pyproject.tom
|
||||
|
||||
# --- Web App Dependencies ---
|
||||
# Copy web app manifest files
|
||||
COPY src/interface/web/package.json src/interface/web/yarn.lock ./src/interface/web/
|
||||
COPY src/interface/web/package.json src/interface/web/yarn.lock /tmp/web/
|
||||
|
||||
# Install web app dependencies
|
||||
# note: yarn will be available from the "features" in devcontainer.json
|
||||
RUN yarn install --cwd ./src/interface/web
|
||||
RUN yarn install --cwd /tmp/web --cache-folder /opt/yarn-cache
|
||||
|
||||
# The .venv and node_modules are now populated in the image.
|
||||
# The rest of the source code will be mounted by VS Code from your local checkout,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"unifiedjs.vscode-mdx"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/workspace/.venv/bin/python",
|
||||
"python.defaultInterpreterPath": "/opt/venv/bin/python",
|
||||
"python.formatting.provider": "black",
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.mypyEnabled": true,
|
||||
@@ -47,38 +47,10 @@
|
||||
],
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.pytestEnabled": true,
|
||||
"launch": {
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Khoj",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "src.khoj.main",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"sudo": true,
|
||||
"args": [
|
||||
"-v",
|
||||
"--anonymous-mode",
|
||||
"--non-interactive",
|
||||
"--port=42110"
|
||||
],
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"env": {
|
||||
"KHOJ_ADMIN_EMAIL": "admin",
|
||||
"KHOJ_ADMIN_PASSWORD": "admin",
|
||||
"USE_EMBEDDED_DB": "true",
|
||||
"KHOJ_DEBUG": "true",
|
||||
"KHOJ_TELEMETRY_DISABLED": "true",
|
||||
"PROMPTRACE_DIR": "${workspaceFolder}/promptrace"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "scripts/dev_setup.sh",
|
||||
"postCreateCommand": "scripts/dev_setup.sh --devcontainer",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
|
||||
29
.devcontainer/launch.json
Normal file
29
.devcontainer/launch.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Khoj",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "src.khoj.main",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"sudo": true,
|
||||
"args": [
|
||||
"-v",
|
||||
"--anonymous-mode",
|
||||
"--non-interactive",
|
||||
"--port=42110"
|
||||
],
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"env": {
|
||||
"KHOJ_ADMIN_EMAIL": "admin",
|
||||
"KHOJ_ADMIN_PASSWORD": "admin",
|
||||
"USE_EMBEDDED_DB": "true",
|
||||
"KHOJ_DEBUG": "true",
|
||||
"KHOJ_TELEMETRY_DISABLED": "true",
|
||||
"PROMPTRACE_DIR": "${workspaceFolder}/promptrace"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user