Add Oh My Pi and improve dev container config

- Install @oh-my-pi/pi-coding-agent and move Go binaries to /usr/local/bin
- Add omp-data volume and make web port configurable via PORT_WEB
- Replace aider self-check with omp in Makefile
- Harden entrypoint: avoid exporting API keys to SSH env and overwrite
  mounted public key into authorized_keys
- Add .dockerignore, simplify .env.example, and document omp in README
This commit is contained in:
2026-06-22 21:51:56 +08:00
parent a2eba73cef
commit 518eb5a90e
8 changed files with 106 additions and 66 deletions

View File

@@ -1,51 +1,33 @@
# =================================================================
# Vibe Coding 开发环境 - 环境变量模板
# 使用说明:
# 1. 复制此文件并重命名为 .env
# 2. 在 .env 中填写你真实的 API Key 和配置
# 3. 注意:不要将 .env 文件上传到 Git 仓库!
# =================================================================
# ========================================
# Vibe Coding 环境配置模板
# ========================================
# 使用方法: cp .env.example .env然后填入实际值
# --- [SSH 配置] ---
# 宿主机连接容器时使用的端口
SSH_PORT=2222
# --- [AI 工具 API Keys] ---
# Aider / OpenCode-AI 需要使用的模型密钥
# 常用模型提供商Anthropic (Claude), OpenAI (GPT), 智谱AI (GLM)
# Anthropic API (用于 Claude 3.5 Sonnet, Aider 强烈推荐)
ANTHROPIC_API_KEY=your_anthropic_key_here
# OpenAI API (用于 GPT-4o 等)
OPENAI_API_KEY=your_openai_key_here
# OpenCode-AI 专用 (例如智谱 AI Key)
OPENCODE_API_KEY=your_opencode_provider_key_here
# --- [开发环境设置 (可选)] ---
# 你可以在这里指定镜像构建时使用的版本(如果 Dockerfile 支持 args
RUST_VERSION=stable
BUN_VERSION=latest
# --- [其他工具配置] ---
# 例如某些工具需要的环境变量
# GITHUB_TOKEN=your_github_pat_here
# 开发者信息
# GIT_USER_NAME=YourName
# GIT_USER_EMAIL=youremail@example.com
# --- [路径配置] ---
# 宿主机项目代码目录 (默认为当前目录 .)
# --- 工作区路径 ---
# 宿主机项目路径 (会被挂载到容器的 /workspace)
HOST_PROJECT_PATH=.
# 容器内工作目录绝对路径 (建议保持为 /workspace)
# 容器内工作目录
CONTAINER_WORKSPACE_PATH=/workspace
# --- [SSH 密钥配置] ---
# 指定你宿主机上的私钥文件名 (例如 id_ed25519 或 id_rsa)
SSH_KEY_NAME=id_ed25519
# 宿主机上公钥的完整路径 (用于 Compose 挂载)
# --- SSH 配置 ---
# SSH 端口映射 (宿主机:容器)
SSH_PORT=2222
# 宿主机公钥路径 (会被自动注入到容器 authorized_keys)
# 持久化公钥请通过此变量配置,手动 make add-key 添加的公钥重启后会丢失
SSH_PUB_KEY_PATH=~/.ssh/id_ed25519.pub
# --- 服务端口 ---
# Web 服务端口映射 (宿主机:容器,容器内默认监听 3000)
PORT_WEB=6300
# --- AI Provider API Keys (按需填写,全部默认注释) ---
# Anthropic (Claude) - opencode / omp 支持
# ANTHROPIC_API_KEY=sk-ant-xxx
# OpenAI - opencode / omp 支持
# OPENAI_API_KEY=sk-xxx
# OpenCode 自定义配置
# OPENCODE_API_KEY=xxx