Files
PMOCrazycoder/docker-entrypoint.sh
Eric Coissac f984f5f062 Update devcontainer and Docker setup with new LLM API configuration
Update devcontainer.json to set terminal shell and add empty features object
Update docker-compose.yml to change port mapping and add environment variable for LOCAL_LLM_API
Add new OpenCode configuration files for LLM settings and instructions
Update Dockerfile to install additional tools and dependencies including Go, Rust, Node.js, and Python packages
Modify docker-entrypoint.sh to handle MCP server initialization and shell configuration
Update LM client readme to reflect new API endpoint configuration
2026-02-21 16:34:27 +01:00

30 lines
861 B
Bash
Executable File

#!/bin/bash
# docker-entrypoint.sh
# --- Initialise .ai_index si nécessaire ---
if [ ! -d "/workspace/.ai_index" ]; then
mkdir -p /workspace/.ai_index/ast
mkdir -p /workspace/.ai_index/embeddings
touch /workspace/.ai_index/graph.db
fi
# --- Configure LOCAL_LLM_API pour Bash ---
if [ -n "$LOCAL_LLM_API" ]; then
if ! grep -q "LOCAL_LLM_API" /home/devuser/.bashrc; then
echo "export LOCAL_LLM_API=$LOCAL_LLM_API" >> /home/devuser/.bashrc
fi
fi
# --- Lance MCP server en background si pas déjà lancé ---
if [ ! -f "/workspace/.ai_index/mcp.pid" ] || ! kill -0 $(cat /workspace/.ai_index/mcp.pid) 2>/dev/null; then
/opt/bin/mcp-server >/workspace/.ai_index/mcp.log 2>&1 &
echo $! >/workspace/.ai_index/mcp.pid
fi
# --- Force Bash comme shell par défaut ---
if [ -z "$1" ]; then
exec /bin/bash
else
exec "$@"
fi