diff --git a/docs/hamilton-ui/ui.rst b/docs/hamilton-ui/ui.rst index c1db0bed0..fb204f9a4 100644 --- a/docs/hamilton-ui/ui.rst +++ b/docs/hamilton-ui/ui.rst @@ -118,6 +118,14 @@ Self-Hosting If you know docker, you should be good to go. The one environment variable to know is `HAMILTON_ALLOWED_HOSTS`, which you can set to `*` to allow all hosts, or a comma separated list of hosts you want to allow. +To host the UI on a subpath, set `REACT_APP_HAMILTON_SUB_PATH` to the subpath required. For example, to run on `https://domain.com/hamilton`: + +.. code-block:: yaml + + - REACT_APP_HAMILTON_SUB_PATH=/hamilton + +Make sure that the sub path environment variable begins with `/` if set. + Please reach out to us if you want to deploy on your own infrastructure and need help - `join slack `_. More extensive self-hosting documentation is in the works, e.g. Snowflake, Databricks, AWS, GCP, Azure, etc.; we'd love a helm chart contribution! diff --git a/ui/frontend/src/App.tsx b/ui/frontend/src/App.tsx index 7dd9f8174..c0b0f5b68 100644 --- a/ui/frontend/src/App.tsx +++ b/ui/frontend/src/App.tsx @@ -28,6 +28,7 @@ import { UserContext } from "./auth/Login"; import { LocalAccount } from "./auth/LocalAccount"; export const localMode = process.env.REACT_APP_AUTH_MODE === "local"; +export const subPath = process.env.REACT_APP_HAMILTON_SUB_PATH || "" const useAuthInfoBasedOnProcEnv = () => { if (localMode) { @@ -99,7 +100,7 @@ export const App = () => { includeHelp: true, }} > - + {localMode && ( } />