Enhance Docker setup with new tools and configurations

Update Dockerfile to install additional tools (orla, rust-analyzer), configure user permissions, and set up bash completion.

Update docker-entrypoint.sh to export new environment variables and configure MCP language servers for multiple languages (Go, Python, Rust, TypeScript) with proper workspace and LSP settings.

Add new documentation file AGENTS.md with development guidelines and security rules.

Add pyproject.toml for Python project configuration with dependencies and dev tools.

Add src/PMOCrazyCoder.py as a new MCP server implementation with example tools.
This commit is contained in:
2026-02-21 21:04:13 +01:00
parent ea29352f7a
commit 9c914b989b
5 changed files with 182 additions and 37 deletions

View File

@@ -3,7 +3,10 @@
export USERNAME=${USERNAME:-devuser}
export WORKSPACE=${WORKSPACE:-/workspace}
export LOCAL_LLM_API=${LOCAL_LLM_API:-http://host.docker.internal:1248/v1}
export LLM_MODEL=${LLM_MODEL:-'ollama:qwen/qwen3-coder-next@4bit'}
export ORLA_OLLAMA_HOST=$(sed -E 's@(https?://[^/]+).*$@\1@' <<< $LOCAL_LLM_API)
export MAXTOKEN=${MAXTOKEN:-4096}
export NUM_CTX=${NUM_CTX:-32768}
export REPEAT_PENALTY=${REPEAT_PENALTY:-1.3}
@@ -23,6 +26,8 @@ fi
if [ -n "$LOCAL_LLM_API" ]; then
if ! grep -q "LOCAL_LLM_API" /home/${USERNAME}/.bashrc; then
echo "export LOCAL_LLM_API=$LOCAL_LLM_API" >> /home/${USERNAME}/.bashrc
echo "export ORLA_OLLAMA_HOST=$ORLA_OLLAMA_HOST" >> /home/${USERNAME}/.bashrc
echo "export ORLA_MODEL='${LLM_MODEL}'" >> /home/${USERNAME}/.bashrc
fi
mkdir -p /home/${USERNAME}/.config/opencode
@@ -31,6 +36,45 @@ if [ -n "$LOCAL_LLM_API" ]; then
cat > $CONFIG_FILE <<EOF
{
"\$schema": "https://opencode.ai/config.json",
"mcp": {
"go-lsp-tools": {
"type": "local",
"command": ["mcp-language-server",
"--workspace", "$WORKSPACE",
"--lsp", "gopls"
],
"enabled": true,
"environment": {
"GOPATH": "$GOPATH"
}
},
"python-lsp-tools": {
"type": "local",
"command": ["mcp-language-server",
"--workspace", "$WORKSPACE",
"--lsp", "pyright-langserver",
"--", "--stdio"
],
"enabled": true
},
"rust-lsp-tools": {
"type": "local",
"command": ["mcp-language-server",
"--workspace", "$WORKSPACE",
"--lsp", "$(find /usr/local/rustup/toolchains -type f -name rust-analyzer)"
],
"enabled": true
},
"typescript-lsp-tools": {
"type": "local",
"command": ["mcp-language-server",
"--workspace", "$WORKSPACE",
"--lsp", "typescript-language-server",
"--", "--stdio"
],
"enabled": true
},
},
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
@@ -75,44 +119,13 @@ if [ -n "$LOCAL_LLM_API" ]; then
}
}
},
"model": "lmstudio/qwen/qwen3-coder-next@4bit"
"model": "${LLM_MODEL}"
}
EOF
chown ${USERNAME}:${USERNAME} ${CONFIG_FILE}
fi
# --- Install MCP Language Server ---
if command -v mcp-language-server &> /dev/null; then
mkdir -p /home/${USERNAME}/.config/opencode
MCP_CONFIG=/home/${USERNAME}/.config/opencode/mcp_servers.json
cat > $MCP_CONFIG <<EOF
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/workspace",
"--lsp",
"gopls"
],
"env": {
"PATH": "/usr/local/go/bin:/usr/local/cargo/bin:/usr/local/bin:$PATH",
"GOPATH": "/home/${USERNAME}/go",
"GOCACHE": "/home/${USERNAME}/.cache/go-build",
"GOMODCACHE": "/home/${USERNAME}/go/pkg/mod"
}
}
}
}
EOF
chown ${USERNAME}:${USERNAME} $MCP_CONFIG
fi
# --- Force Bash comme shell par défaut ---
if [ -z "$1" ]; then
exec /bin/bash