瀏覽代碼

do not enable reload when deploying to fly.io

Rodja Trappe 1 年之前
父節點
當前提交
652f3aca06
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 3 0
      fly.dockerfile
  2. 3 1
      main.py

+ 3 - 0
fly.dockerfile

@@ -33,4 +33,7 @@ COPY fly-entrypoint.sh /entrypoint.sh
 
 ENTRYPOINT ["/entrypoint.sh"]
 
+ENV PYTHONUNBUFFERED=1
+ENV NICEGUI_PRODUCTION=true
+
 CMD ["python", "main.py"]

+ 3 - 1
main.py

@@ -447,4 +447,6 @@ def status():
     return 'Ok'
 
 
-ui.run(uvicorn_reload_includes='*.py, *.css, *.html', reconnect_timeout=3.0)
+ui.run(uvicorn_reload_includes='*.py, *.css, *.html',
+       reload=not os.environ.get('NICEGUI_PRODUCTION').lower() == 'true',
+       reconnect_timeout=3.0)