joddabod commited on
Commit
8c65d3d
·
verified ·
1 Parent(s): e2b893f

deploy bbuilder host

Browse files
__pycache__/noderuntime.cpython-314.pyc DELETED
Binary file (6.86 kB)
 
__pycache__/store.cpython-314.pyc DELETED
Binary file (5.92 kB)
 
__pycache__/supervisor.cpython-314.pyc DELETED
Binary file (23 kB)
 
app.py CHANGED
@@ -258,7 +258,7 @@ def status_text() -> str:
258
  )
259
 
260
 
261
- with gr.Blocks(title="bbuilder host", theme=gr.themes.Soft()) as demo:
262
  gr.Markdown("# bbuilder host\nHosting for Nerimity bots built with the bbuilder desktop app.")
263
  status_md = gr.Markdown(status_text())
264
  table = gr.Dataframe(
@@ -282,4 +282,8 @@ if __name__ == "__main__":
282
  BOTS_DIR.mkdir(parents=True, exist_ok=True)
283
  threading.Thread(target=bootstrap, daemon=True).start()
284
  threading.Thread(target=self_ping, daemon=True).start()
285
- uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 7860)))
 
 
 
 
 
258
  )
259
 
260
 
261
+ with gr.Blocks(title="bbuilder host") as demo:
262
  gr.Markdown("# bbuilder host\nHosting for Nerimity bots built with the bbuilder desktop app.")
263
  status_md = gr.Markdown(status_text())
264
  table = gr.Dataframe(
 
282
  BOTS_DIR.mkdir(parents=True, exist_ok=True)
283
  threading.Thread(target=bootstrap, daemon=True).start()
284
  threading.Thread(target=self_ping, daemon=True).start()
285
+ # Gradio Spaces expose the app on GRADIO_SERVER_PORT (7860) and route the public domain
286
+ # there. Do NOT fall back to $PORT: HF sets it to something else in the container (7861,
287
+ # already bound), so trusting it makes the app fail to start with EADDRINUSE.
288
+ port = int(os.environ.get("GRADIO_SERVER_PORT") or 7860)
289
+ uvicorn.run(app, host="0.0.0.0", port=port)