Update Dockerfile
Browse files5 unmodified lines678910111213141516171819202122235 unmodified lines# 创建代理服务 main.pyRUN echo 'from fastapi import FastAPI, Request' > main.py && \echo ' from fastapi.responses import JSONResponse' >> main.py && \echo ' import google.generativeai as genai' >> main.py && \echo ' import os, uvicorn' >> main.py && \echo ' app = FastAPI()' >> main.py && \echo ' GOOGLE_API_KEY = os.environ["GOOGLE_API_KEY"]' >> main.py && \echo ' genai.configure(api_key=GOOGLE_API_KEY)' >> main.py && \echo ' @app.get("/v1/models")' >> main.py && \echo ' @app.post("/v1/embeddings")' >> main.py && \echo ' @app.post("/v1/chat/completions")' >> main.py && \echo ' async def catch_all(request: Request):' >> main.py && \echo ' return JSONResponse({"message": "Gemini Proxy is running"})' >> main.py && \echo ' if __name__ == "__main__":' >> main.py && \echo ' uvicorn.run(app, host="0.0.0.0", port=7860)' >> main.pyCMD ["python", "main.py"]5 unmodified lines678910111213141516171819202122235 unmodified lines# 创建代理服务 main.pyRUN echo 'from fastapi import FastAPI, Request' > main.py && \echo 'from fastapi.responses import JSONResponse' >> main.py && \echo 'import google.generativeai as genai' >> main.py && \echo 'import os, uvicorn' >> main.py && \echo 'app = FastAPI()' >> main.py && \echo 'GOOGLE_API_KEY = os.environ["GOOGLE_API_KEY"]' >> main.py && \echo 'genai.configure(api_key=GOOGLE_API_KEY)' >> main.py && \echo '@app.get("/v1/models")' >> main.py && \echo '@app.post("/v1/embeddings")' >> main.py && \echo '@app.post("/v1/chat/completions")' >> main.py && \echo 'async def catch_all(request: Request):' >> main.py && \echo 'return JSONResponse({"message": "Gemini Proxy is running"})' >> main.py && \echo 'if __name__ == "__main__":' >> main.py && \echo 'uvicorn.run(app, host="0.0.0.0", port=7860)' >> main.pyCMD ["python", "main.py"]
Dockerfile+13-13