Spaces:
Sleeping
Sleeping
lucianotonet
commited on
Commit
·
bf795ac
1
Parent(s):
a312b20
Add root path to work behind a proxy
Browse files- Dockerfile +1 -1
- Procfile +2 -1
- 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="
|
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": "
|
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")
|