mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
There seems to be a more standard mechanism of specifying launch.json params for devcontainers. Previous mechanism to write launch.json to .vscode/launch.json in post creation step does not work. Improve default launch.json to include khoj admin username, password with placeholder values to get started with local development faster. Define dockerfile for devcontainer to pre-built server, web app dependencies during dev container image creation stage. So install on dev container startup is sped up as no need to install dependencies.
96 lines
3.5 KiB
JSON
96 lines
3.5 KiB
JSON
{
|
|
"name": "Khoj Development Environment",
|
|
"build": {
|
|
"dockerfile": "Dockerfile",
|
|
"context": "..", // Build context is the project root
|
|
"args": {
|
|
"PYTHON_VERSION": "3.10"
|
|
}
|
|
},
|
|
"forwardPorts": [
|
|
42110
|
|
],
|
|
"containerEnv": {
|
|
"USE_EMBEDDED_DB": "True"
|
|
},
|
|
"customizations": {
|
|
"vscode": {
|
|
"extensions": [
|
|
"ms-python.python",
|
|
"ms-python.vscode-pylance",
|
|
"ms-python.black-formatter",
|
|
"ms-python.mypy-type-checker",
|
|
"ms-python.isort",
|
|
"esbenp.prettier-vscode",
|
|
"GitHub.copilot",
|
|
"GitHub.copilot-chat",
|
|
"GitHub.vscode-pull-request-github",
|
|
"github.vscode-github-actions",
|
|
"unifiedjs.vscode-mdx"
|
|
],
|
|
"settings": {
|
|
"python.defaultInterpreterPath": "/workspace/.venv/bin/python",
|
|
"python.formatting.provider": "black",
|
|
"python.linting.enabled": true,
|
|
"python.linting.mypyEnabled": true,
|
|
"python.linting.mypyArgs": [
|
|
"--config-file=pyproject.toml"
|
|
],
|
|
"mypy.configFile": "pyproject.toml",
|
|
"isort.args": [
|
|
"--profile",
|
|
"black",
|
|
"--filter-files"
|
|
],
|
|
"python.testing.pytestArgs": [
|
|
"tests"
|
|
],
|
|
"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",
|
|
"features": {
|
|
"ghcr.io/devcontainers-contrib/features/black:2": {},
|
|
"ghcr.io/devcontainers-contrib/features/mypy:2": {},
|
|
"ghcr.io/devcontainers-contrib/features/isort:2": {},
|
|
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
|
|
"ghcr.io/devcontainers/features/github-cli:1": {},
|
|
"ghcr.io/devcontainers/features/node:1": {
|
|
"version": "lts",
|
|
"installYarnUsingApt": false,
|
|
"nodeGypDependencies": true
|
|
}
|
|
},
|
|
"remoteUser": "vscode"
|
|
}
|