lucianotonet commited on
Commit
3650674
·
1 Parent(s): 343055a

Move root path to env var

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. Procfile +2 -1
  3. app/server.py +3 -1
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 --root-path "https://app.agenciamav.com.br/api/ai"
 
18
 
19
  EXPOSE 7860
20
 
21
+ CMD exec uvicorn app.server:app --host 0.0.0.0 --port 7860 --root-path $PROXY_URL
Procfile CHANGED
@@ -1,2 +1,3 @@
1
- web: uvicorn app.server:app --host 0.0.0.0 --port $PORT --root-path "https://app.agenciamav.com.br/api/ai"
 
2
 
 
1
+ web: uvicorn app.server:app --host 0.0.0.0 --port $PORT --root-path $PROXY_URL
2
+
3
 
app/server.py CHANGED
@@ -35,4 +35,6 @@ add_routes(
35
  if __name__ == "__main__":
36
  import uvicorn
37
 
38
- uvicorn.run(app, host="localhost", port=7860, root_path="https://app.agenciamav.com.br/api/ai")
 
 
 
35
  if __name__ == "__main__":
36
  import uvicorn
37
 
38
+ import os
39
+ app_url = os.getenv('PROXY_URL')
40
+ uvicorn.run(app, host="localhost", port=7860, root_path=app_url)