haibbo / cf-openai-azure-proxy

A Cloudflare worker script to proxy OpenAI‘s request to Azure OpenAI Service
MIT License
1.66k stars 206 forks source link

docker run命令和https访问 #38

Closed manjieqi closed 1 year ago

manjieqi commented 1 year ago

docker run -d -p 8787:8787 -t \ --name cf-azure-openai-proxy \ --env RESOURCE_NAME=codegpt \ --env DEPLOY_NAME_GPT35=gpt3 \ --env DEPLOY_NAME_GPT4=gpt4 \ haibbo/cf-openai-azure-proxy:latest 好像指定容器名要加--name,不加它就识别成镜像名,然后没有这个镜像

我本地运行好像也可以

怎么实现https访问啊?想部署到服务器上(不然就闲置了)

ShinChven commented 1 year ago

在服务器上用 certbot + nginx 部署证书就能实现 https 访问了。

https://atlassc.net/2020/11/09/install-certbot

具体原理是在 Nginx 上设置域名反向代理到你的 container 的 http 端口,然后使用 certbot 自动部署免费的 SSL 证书并根据你的 http 反向代理创建 https 反向代理。

manjieqi commented 1 year ago

实现了,用了Nginx容器部署了腾讯云申请的SSL证书。两个容器内存占用400M左右,然后好像速度和deno部署的差不多。