fix: serve frontend and configure local web port
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
WISEGRADE_DATA_DIR=./data/inbox
|
||||
WISEGRADE_WEB_PORT=8080
|
||||
DATABASE_URL=postgresql+psycopg://wisegrade:wisegrade@db:5432/wisegrade
|
||||
REDIS_URL=redis://redis:6379/0
|
||||
DEEPSEEK_BASE_URL=https://api.deepseek.com
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ services:
|
||||
web:
|
||||
build: ./frontend
|
||||
ports:
|
||||
- "127.0.0.1:8080:80"
|
||||
- "127.0.0.1:${WISEGRADE_WEB_PORT:-8080}:80"
|
||||
depends_on: [api]
|
||||
healthcheck:
|
||||
test: [CMD, wget, -q, -O, /dev/null, "http://127.0.0.1/health"]
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
# WiseGrade(智评)部署与使用
|
||||
|
||||
WiseGrade 是单机单管理员教师端。Web 服务仅绑定 `127.0.0.1:8080`。学生原件通过只读目录挂载进入容器,不经过浏览器上传。
|
||||
WiseGrade 是单机单管理员教师端。Web 服务仅绑定 `127.0.0.1`,默认端口为 `8080`,可通过 `.env` 中的 `WISEGRADE_WEB_PORT` 修改。学生原件通过只读目录挂载进入容器,不经过浏览器上传。
|
||||
|
||||
## 准备
|
||||
|
||||
@@ -37,6 +37,8 @@ curl http://127.0.0.1:8080/api/health
|
||||
|
||||
打开 <http://127.0.0.1:8080>。`api` 启动时执行 Alembic 迁移并创建初始课程、目标、指标点和规则。评分任务由 `worker` 容器处理。
|
||||
|
||||
如 `8080` 端口已被占用,在 `.env` 中设置 `WISEGRADE_WEB_PORT=18080`(或其他空闲端口),重新运行 `docker compose up -d`,并使用对应端口访问。
|
||||
|
||||
## Windows Docker Desktop 启动
|
||||
|
||||
1. 安装 Docker Desktop,启用 WSL2 后端并允许访问存放材料的磁盘。
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
location = /health { add_header Content-Type text/plain; return 200 'ok'; }
|
||||
location /api/ { proxy_pass http://api:8000; proxy_set_header Host $host; client_max_body_size 1m; }
|
||||
location / { try_files $uri /index.html; }
|
||||
|
||||
Reference in New Issue
Block a user