Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

如何通过Docker快速部署geminicli2api服务?

2025-08-22 448

容器化部署是geminicli2api最推荐的部署方式,分为三个步骤:

1. 构建镜像::
在项目目录执行 docker build -t geminicli2api . 命令,Dockerfile已内置FastAPI环境配置

2. 环境变量配置::
运行容器时必须通过-e参数传递:
GEMINI_AUTH_PASSWORD(API访问密码)
GEMINI_CREDENTIALS(Google OAuth JSON字符串)
或挂载包含凭据的credentialscatalogs

3. 端口映射::
标准部署使用-p 8888:8888,Hugging Face Spaces需改为7860端口
完整示例:
docker run -p 8888:8888 -e GEMINI_AUTH_PASSWORD=xxx -e GEMINI_CREDENTIALS='{...}' geminicli2api

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish