Files
deploy.stack/it-tools/readme.md

59 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IT Tools 部署栈
[IT Tools](https://github.com/CorentinTh/it-tools) 是一个面向开发者的在线工具集合,提供编码、转换、格式化、加密等多种实用功能。基于 Vue + TypeScript 构建,拥有良好的交互体验。
## 目录结构
| 文件 | 说明 |
|------|------|
| `compose.yml` | Docker Compose 部署配置 |
| `env.cfg` | 环境变量(镜像版本,已 gitignore |
| `env.cfg.example` | 环境变量模板 |
## 部署命令
```bash
# 拉取镜像
docker compose -p it-tools --env-file ./it-tools/env.cfg -f ./it-tools/compose.yml pull
# 部署
docker compose -p it-tools --env-file ./it-tools/env.cfg -f ./it-tools/compose.yml up -d
```
## 环境变量
| 变量 | 说明 | 示例 |
|------|------|------|
| `IMAGE_TAG` | 完整镜像标签 | `hub.6t7.net/cnphpbb/it-tools:20241022` |
## 服务端口
| 宿主机 | 容器 |
|--------|------|
| `8380` | `80` |
## Docker 构建说明
上游仓库包含 `Dockerfile`支持多阶段构建node 构建 → nginx 运行):
```bash
git clone https://github.com/CorentinTh/it-tools.git
cd it-tools
# 构建镜像
docker buildx build --platform linux/amd64 -t hub.6t7.net/cnphpbb/it-tools:<tag> .
# 推送到仓库
docker push hub.6t7.net/cnphpbb/it-tools:<tag>
```
构建依赖:
- 构建阶段:`node:lts-alpine` + `pnpm`,执行 `pnpm build` 生成静态文件
- 运行阶段:`nginx:stable-alpine`,提供 `nginx.conf` 自定义配置
- 环境变量:`NPM_CONFIG_LOGLEVEL=warn``CI=true`
- 上游 Dockerfile 参考:[Dockerfile](https://github.com/CorentinTh/it-tools/blob/main/Dockerfile)
## 相关链接
- GitHub: <https://github.com/CorentinTh/it-tools>
- 在线体验: <https://it-tools.tech>