更新 Dockerfile 和新增 docker-compose.yml 文件

This commit is contained in:
2026-04-30 15:49:26 +08:00
parent 0d567644c8
commit f6c45f1ba5
4 changed files with 42 additions and 3 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.7
FROM oven/bun:1.3.13 AS deps
FROM oven/bun:canary-slim AS deps
WORKDIR /app
COPY package.json bun.lock ./
@@ -15,7 +15,7 @@ COPY src ./src
COPY .opencode ./.opencode
RUN bun run check
FROM oven/bun:1.3.13 AS runner
FROM oven/bun:canary-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
+21
View File
@@ -201,6 +201,27 @@ bun install
bun run start:prod
```
### Docker Compose 启动
项目根目录已提供 `Dockerfile``docker-compose.yml`,可直接使用:
```bash
cd TJWaterAgent
docker compose up -d --build
```
查看日志:
```bash
docker compose logs -f tjwater-agent
```
停止并清理容器:
```bash
docker compose down
```
### 常用脚本
| 命令 | 作用 |
+18
View File
@@ -0,0 +1,18 @@
services:
tjwater-agent:
container_name: tjwater-agent
build:
context: .
dockerfile: Dockerfile
image: tjwater-agent:latest
env_file:
- .local.env
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 8787
DEEPSEEK_API_KEY: "sk-8941428ad9be4c789becfa8d66534aba"
TJWATER_API_BASE_URL: "http://127.0.0.1:8000"
ports:
- "8787:8787"
restart: unless-stopped
+1 -1
View File
@@ -13,4 +13,4 @@
"port": 4096
},
"default_agent": "agent"
}
}