lucianotonet commited on
Commit
6fca5d8
·
1 Parent(s): 169c339

Change env vars

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. app/server.py +3 -3
Dockerfile CHANGED
@@ -17,4 +17,4 @@ RUN poetry install --no-interaction --no-ansi
17
 
18
  EXPOSE 7860
19
 
20
- CMD exec uvicorn app.server:app --host 0.0.0.0 --port 7860 --root-path $PROXY_URL
 
17
 
18
  EXPOSE 7860
19
 
20
+ CMD exec uvicorn app.server:app --host 0.0.0.0 --port 7860 --root-path $PROXY_URL --prefix $PROXY_PREFIX
app/server.py CHANGED
@@ -9,7 +9,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
9
 
10
  load_dotenv()
11
  import os
12
- app_url = os.getenv('PROXY_URL')
13
 
14
  app = FastAPI(
15
  title="Mav AI API",
@@ -21,7 +21,7 @@ app = FastAPI(
21
  @app.get("/")
22
  async def root():
23
  # return json response
24
- return {"message": "Mav AI API is running"}
25
 
26
  add_routes(
27
  path = "/openai",
@@ -37,4 +37,4 @@ add_routes(
37
 
38
  if __name__ == "__main__":
39
  import uvicorn
40
- uvicorn.run(app, host="localhost", port=7860, root_path=app_url)
 
9
 
10
  load_dotenv()
11
  import os
12
+ api_url = os.getenv('PROXY_URL') + os.getenv('PROXY_PREFIX')
13
 
14
  app = FastAPI(
15
  title="Mav AI API",
 
21
  @app.get("/")
22
  async def root():
23
  # return json response
24
+ return {"message": "MAV API is up and running!"}
25
 
26
  add_routes(
27
  path = "/openai",
 
37
 
38
  if __name__ == "__main__":
39
  import uvicorn
40
+ uvicorn.run(app, host="localhost", port=7860, root_path=api_url, prefix=os.getenv('PROXY_PREFIX'))