tao-shen commited on
Commit
0f7da25
·
1 Parent(s): cb79e6d

Enhance Dockerfile to allow CORS for specified origins in OpenCode server, enabling cross-origin requests from Vercel deployed clients.

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -1
Dockerfile CHANGED
@@ -39,5 +39,6 @@ EXPOSE 7860
39
 
40
  # 启动 headless HTTP server,监听 0.0.0.0 以便 Space 代理访问
41
  # 使用绝对路径,避免 UID 1000 下 PATH 未生效
 
42
  # 文档与 API: /doc 为 OpenAPI 3.1 规范
43
- CMD ["/home/user/.opencode/bin/opencode", "serve", "--port", "7860", "--hostname", "0.0.0.0"]
 
39
 
40
  # 启动 headless HTTP server,监听 0.0.0.0 以便 Space 代理访问
41
  # 使用绝对路径,避免 UID 1000 下 PATH 未生效
42
+ # --cors 允许前端从指定 origin 跨域请求(Vercel 部署的 opencode web 客户端)
43
  # 文档与 API: /doc 为 OpenAPI 3.1 规范
44
+ CMD ["/home/user/.opencode/bin/opencode", "serve", "--port", "7860", "--hostname", "0.0.0.0", "--cors", "https://tacits-candy-shop.vercel.app", "--cors", "https://opencode-web-pearl.vercel.app"]