> ## Documentation Index
> Fetch the complete documentation index at: https://imageflowdoc.sakiko.de/llms.txt
> Use this file to discover all available pages before exploring further.

# 部署

本指南帮助您安装和设置 ImageFlow。

## 前置条件

* Go 1.22 或更高版本
* Node.js 18 或更高版本（用于构建前端）
* WebP 工具（`libwebp-tools`）
* AVIF 工具（`libavif-apps`）
* Redis（可选，用于元数据和标签存储）
* Docker 和 Docker Compose（可选，用于容器化部署）

## 安装

### Docker 部署

#### 使用预构建镜像（推荐）

1. **克隆仓库**
   ```bash theme={null}
   git clone https://github.com/Yuri-NagaSaki/ImageFlow.git
   cd ImageFlow
   ```

2. **配置环境变量**

   复制示例环境文件并进行编辑：

   ```bash theme={null}
   cp .env.example .env
   # 编辑 .env 文件
   ```

   确保 Docker 可以访问此 `.env` 文件，或者直接在 `docker-compose.yaml` 中配置环境变量。

3. **启动服务**
   ```bash theme={null}
   docker compose up -d
   ```

#### 本地构建部署

1. **克隆仓库**
   ```bash theme={null}
   git clone https://github.com/Yuri-NagaSaki/ImageFlow.git
   cd ImageFlow
   ```

2. **配置环境变量**
   ```bash theme={null}
   cp .env.example .env
   # 编辑 .env 文件
   ```

3. **构建并启动**
   ```bash theme={null}
   docker compose -f docker-compose-build.yml up --build -d
   ```
