lucianotonet commited on
Commit
bf795ac
·
1 Parent(s): a312b20

Add root path to work behind a proxy

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. Procfile +2 -1
  3. app/server.py +3 -3
Dockerfile CHANGED
@@ -18,4 +18,4 @@ RUN poetry install --no-interaction --no-ansi
18
 
19
  EXPOSE 7860
20
 
21
- CMD exec uvicorn app.server:app --host 0.0.0.0 --port 7860
 
18
 
19
  EXPOSE 7860
20
 
21
+ CMD exec uvicorn app.server:app --host 0.0.0.0 --port 7860 --root-path /api/ai
Procfile CHANGED
@@ -1 +1,2 @@
1
- web: uvicorn app.server:app --host 0.0.0.0 --port $PORT
 
 
1
+ web: uvicorn app.server:app --host 0.0.0.0 --port $PORT --root-path /api/ai
2
+
app/server.py CHANGED
@@ -10,7 +10,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
10
  load_dotenv()
11
 
12
  app = FastAPI(
13
- title="LangChain Server",
14
  version="1.0",
15
  description="A simple api server using Langchain's Runnable interfaces",
16
  )
@@ -18,7 +18,7 @@ app = FastAPI(
18
  @app.get("/")
19
  async def root():
20
  # return json response
21
- return {"message": "LangChain Server is running"}
22
 
23
  add_routes(
24
  path = "/openai",
@@ -35,4 +35,4 @@ add_routes(
35
  if __name__ == "__main__":
36
  import uvicorn
37
 
38
- uvicorn.run(app, host="localhost", port=7860)
 
10
  load_dotenv()
11
 
12
  app = FastAPI(
13
+ title="Mav AI API",
14
  version="1.0",
15
  description="A simple api server using Langchain's Runnable interfaces",
16
  )
 
18
  @app.get("/")
19
  async def root():
20
  # return json response
21
+ return {"message": "Mav AI API is running"}
22
 
23
  add_routes(
24
  path = "/openai",
 
35
  if __name__ == "__main__":
36
  import uvicorn
37
 
38
+ uvicorn.run(app, host="localhost", port=7860, root_path="/api/ai")