add docker file

This commit is contained in:
hsueh chiahao
2025-10-26 11:03:27 +08:00
parent f92417d5e3
commit f335c7546a
4 changed files with 101 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
## 运行步骤
### 本地开发
1. **安装依赖:**
```
npm install
@@ -32,6 +33,31 @@
npm start # 生产模式(需预先构建)
```
### Docker Compose 部署(推荐)
1. **启动所有服务:**
```
docker-compose up --build -d
```
这将启动:
- PostgreSQL 数据库(在 `db` 服务中)
- 许可证服务器应用(在 `app` 服务中,端口 3000
2. **检查服务状态:**
```
docker-compose ps
```
3. **查看日志:**
```
docker-compose logs -f
```
4. **停止服务:**
```
docker-compose down
```
5. **测试 API**
- 健康检查:`GET http://localhost:3000/health`
- 许可证检查:`POST http://localhost:3000/api/license/check`