# 极简启动:仅需配置 Git 仓库地址
docker run -d \
--name devlog \
-p 8787:8787 \
-e DEVLOG_REPO_URL=https://your-git-server.com/your-repo.git \
-e TZ=Asia/Shanghai \
wanrenzhizun/devlog:latest
# 访问 http://localhost:8787
创建 docker-compose.yml:
services:
devlog:
image: wanrenzhizun/devlog:latest
container_name: devlog
restart: unless-stopped
ports:
- "8787:8787"
volumes:
- devlog-data:/app/data
environment:
- TZ=Asia/Shanghai
- DEVLOG_REPO_URL=https://your-git-server.com/your-repo.git
- DEVLOG_REPO_BRANCH=main
- DEVLOG_AI_ENABLED=true
- DEVLOG_AI_API_KEY=sk-xxx
- DEVLOG_AI_BASE_URL=https://api.openai.com/v1
- DEVLOG_AI_MODEL=gpt-4o-mini
- DEVLOG_SITE_NAME=我的知识库
- DEVLOG_SITE_DESCRIPTION=基于 Git 仓库自动构建
volumes:
devlog-data:
docker compose up -d
config.yaml,配置仓库地址等参数# Linux / macOS
./devlog -install # 安装为系统服务(可选)
./devlog -start # 启动服务
# Windows
devlog.exe -install
devlog.exe -start
# 或直接前台运行(调试用)
./devlog
复制 config.example.yaml 为 config.yaml,修改后重启:
server:
addr: ":8787"
distDir: "../dist"
repo:
url: "https://git.woiow.site/your-name/articles.git"
branch: "main"
contentDir: "article"
ai:
enabled: true
baseURL: "https://api.openai.com/v1"
apiKey: "sk-xxx"
model: "gpt-4o-mini"
sync:
interval: 30
site:
name: "我的知识库"
tagline: "AI 技术知识库"
description: "基于 Git 仓库自动构建"
所有 config.yaml 字段均可通过 DEVLOG_* 环境变量覆盖,无需挂载配置文件:
| 环境变量 | 对应配置 | 说明 |
|---|---|---|
DEVLOG_REPO_URL | repo.url | Git 仓库地址(必需) |
DEVLOG_REPO_BRANCH | repo.branch | 仓库分支,默认 main |
DEVLOG_REPO_USERNAME | repo.username | 仓库用户名(私有仓库需要) |
DEVLOG_REPO_PASSWORD | repo.password | 仓库密码 / Token |
DEVLOG_REPO_CONTENT_DIR | repo.contentDir | 文章目录,默认 article |
DEVLOG_REPO_DISPLAY_URL | repo.displayUrl | 前端展示的仓库链接 |
DEVLOG_AI_ENABLED | ai.enabled | 启用 AI,true/false |
DEVLOG_AI_API_KEY | ai.apiKey | AI API Key |
DEVLOG_AI_BASE_URL | ai.baseURL | AI API 基地址 |
DEVLOG_AI_MODEL | ai.model | AI 模型名称 |
DEVLOG_AI_MAX_TOKENS | ai.maxTokens | 最大 token 数,默认 800 |
DEVLOG_AI_TEMPERATURE | ai.temperature | 温度,实际值/10 |
DEVLOG_AI_TIMEOUT | ai.timeout | 请求超时(秒),默认 60 |
DEVLOG_SYNC_INTERVAL | sync.interval | 同步间隔(分钟),默认 30 |
DEVLOG_SERVER_ADDR | server.addr | 监听地址,默认 :8787 |
DEVLOG_SITE_NAME | site.name | 站点名称 |
DEVLOG_SITE_TAGLINE | site.tagline | 站点标语 |
DEVLOG_SITE_DESCRIPTION | site.description | 站点描述 |
DEVLOG_SITE_AUTHOR | site.author | 作者 |
DEVLOG_SITE_EMAIL | site.email | 邮箱 |
DEVLOG_SITE_URL | site.url | 站点 URL |
DEVLOG_SITE_HOME_HERO_TITLE | site.home.hero.title | 首页大标题 |
DEVLOG_SITE_HOME_HERO_SUBTITLE | site.home.hero.subtitle | 首页副标题 |
DEVLOG_SITE_HOME_HERO_DESCRIPTION | site.home.hero.description | 首页描述 |
# 启动(带完整持久化与健康检查)
docker run -d \
--name devlog \
--restart unless-stopped \
-p 8787:8787 \
-v devlog-data:/app/data \
-e TZ=Asia/Shanghai \
-e DEVLOG_REPO_URL=your-repo-url \
-e DEVLOG_AI_ENABLED=true \
-e DEVLOG_AI_API_KEY=your-key \
wanrenzhizun/devlog:latest
# 查看日志
docker logs -f devlog
# 重启
docker restart devlog
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:8787;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# 前端
pnpm install
pnpm run build
# 后端
cd server
go build -o devlog ./cmd/devlog
# 交叉编译所有平台
cd ..
go run ./scripts/build.go -all
| 平台 | amd64 | arm64 |
|---|---|---|
| Linux | ✔️ | ✔️ |
| Windows | ✔️ | ✔️ |
| macOS | ✔️ | ✔️ |
最低要求:无外部依赖,纯静态二进制即可运行。Docker 20.10+。
Content type
Image
Digest
sha256:eed42f1b6…
Size
10.4 MB
Last updated
2 months ago
docker pull wanrenzhizun/devlog