mirror of
https://github.com/basketikun/infinite-canvas.git
synced 2026-08-07 18:25:18 +08:00
feat(i18n): add multilingual support for documentation with Chinese and English content
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
---
|
||||
title: Docker 部署
|
||||
description: 使用 Docker Compose 部署无限画布
|
||||
title: Docker Deployment
|
||||
description: Deploy Infinite Canvas with Docker Compose
|
||||
---
|
||||
|
||||
# Docker 部署
|
||||
# Docker Deployment
|
||||
|
||||
如果你希望在自己的机器或服务器上运行项目,可以直接使用 Docker Compose。
|
||||
|
||||
## 使用发布镜像
|
||||
## Use the published image
|
||||
|
||||
```bash
|
||||
git clone git@github.com:basketikun/infinite-canvas.git
|
||||
@@ -15,54 +13,40 @@ cd infinite-canvas
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
启动后访问:
|
||||
Open `http://localhost:3000`.
|
||||
|
||||
```text
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
## 本地构建镜像
|
||||
|
||||
如果需要基于当前源码构建镜像:
|
||||
## Build locally
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.local.yml up -d --build
|
||||
```
|
||||
|
||||
## 文档站镜像
|
||||
## Documentation image
|
||||
|
||||
文档站位于 `docs/` 目录,按带服务端能力的 Next.js standalone 应用单独构建,不打进主应用镜像。
|
||||
|
||||
使用发布镜像:
|
||||
The documentation in `docs/` is a separate Next.js standalone application with server capabilities.
|
||||
|
||||
```bash
|
||||
cd docs
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
基于当前源码本地构建:
|
||||
To build it from the current source:
|
||||
|
||||
```bash
|
||||
cd docs
|
||||
docker compose -f docker-compose.local.yml up -d --build
|
||||
```
|
||||
|
||||
## 数据说明
|
||||
The main application container only runs Next.js. Canvases, My Assets, generation history, and API keys are stored in the browser by default, while prompt repositories are fetched directly by the frontend. No persistent data volume is required for this data.
|
||||
|
||||
当前主应用镜像只启动 Next.js。画布、我的素材、生成记录和 AI API Key 默认保存在浏览器本地;第三方提示词由浏览器前端直连拉取,不需要额外挂载数据目录。
|
||||
## Optional analytics
|
||||
|
||||
## 统计分析(可选)
|
||||
No analytics are enabled by default. A deployment can enable GA4, Baidu Analytics, or both at runtime:
|
||||
|
||||
项目**默认不接入任何统计**:不设置下列环境变量时,页面不会加载任何统计脚本,也不会发送任何外部请求。你在自己的部署上想查看流量时,设置对应环境变量即可,无需修改代码或重新构建镜像——镜像启动时会据此生成运行期配置。
|
||||
|
||||
统计按「每家一个独立变量」配置:**填了谁就启用谁,可同时启用多家**(例如 GA4 + 百度一起开)。仅支持 GA4 与百度,两者都只接受 ID,脚本地址由代码固定拼接,不接受任意脚本地址或内联 JS。
|
||||
|
||||
| 变量 | 说明 |
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| `ANALYTICS_GA4_ID` | Google Analytics 4 衡量 ID(`G-XXXX`) |
|
||||
| `ANALYTICS_BAIDU_ID` | 百度统计站点 ID(`hm.js?` 后面那串 hash) |
|
||||
|
||||
在 `docker-compose.yml` 的 `environment` 中配置(文件内已附注释示例),下例同时启用 GA4 与百度:
|
||||
| `ANALYTICS_GA4_ID` | Google Analytics 4 measurement ID (`G-XXXX`) |
|
||||
| `ANALYTICS_BAIDU_ID` | Baidu site ID, the hash after `hm.js?` |
|
||||
|
||||
```yaml
|
||||
services:
|
||||
@@ -75,17 +59,4 @@ services:
|
||||
ANALYTICS_BAIDU_ID: e8263761cc5c32f5f7a855b8203b965a
|
||||
```
|
||||
|
||||
或使用 `docker run`:
|
||||
|
||||
```bash
|
||||
docker run -d -p 3000:3000 \
|
||||
-e ANALYTICS_GA4_ID=G-XXXXXXXXXX \
|
||||
-e ANALYTICS_BAIDU_ID=e8263761cc5c32f5f7a855b8203b965a \
|
||||
ghcr.io/basketikun/infinite-canvas:latest
|
||||
```
|
||||
|
||||
单页应用的路由切换会自动向所有已启用的统计上报 pageview。
|
||||
|
||||
<Callout type="warn">
|
||||
请只在你自己的站点上配置统计 ID,不要把 ID 提交进仓库;fork 或自托管本项目的用户默认不会产生任何统计。
|
||||
</Callout>
|
||||
SPA route changes automatically report page views to enabled providers. Only configure analytics IDs on sites you control, and do not commit them to the repository.
|
||||
|
||||
Reference in New Issue
Block a user