is `PREFECT_SERVER__GRAPHQL_URL` the right env var...
# prefect-community
e
is
PREFECT_SERVER__GRAPHQL_URL
the right env variable for the UI docker image? it seems to be the one used in the docker compose file but when ran outside of docker (so not on localhost), it doesn’t seem to be working 😕
n
Hi @emmanuel - are you running the UI from the new repo or from an older version of Server?
e
from
prefecthq/ui:latest
doesn’t seem to work either
n
Gotcha @emmanuel - what are you trying to do?
e
well… simply set the proper graphql endpoint which is not localhost in my deployment?!?
Yes I can do it directly from the UI but it only updates a key in the local storage
so everyone that connect to the UI would have to do it too
n
Ah I see -
VUE_APP_SERVER_URL
is the correct environment variable; the reason it's not updating the default in your UI is that the UI needs to be rebuilt when environment variables are updated
We don't have a great way of updating the default in the built application, because it's an interpolated constant variable
e
right… so this:
Copy code
PREFECT_SERVER__GRAPHQL_URL: ${GRAPHQL_URL:-<http://localhost:4200/graphql>}
in
Copy code
ui:
    image: "prefecthq/ui:${PREFECT_UI_TAG:-latest}"
    ports:
      - "${UI_HOST_PORT:-8080}:8080"
    command: "/intercept.sh"
    environment:
      PREFECT_SERVER__GRAPHQL_URL: ${GRAPHQL_URL:-<http://localhost:4200/graphql>}
    networks:
      - prefect-server
    restart: "always"
    depends_on:
      - apollo
from
prefect/cli/docker-compose.yml
is meaningless for the moment?
n
That's correct @emmanuel - I think we kept that for backwards compatibility with the old version of Server.
e
I see…
n
I'm going to open a ticket for the UI to have a more concrete way of setting a default graphql endpoint
e
that would be quite useful
now that I managed to put the UI and graphql behind the same endpoint to avoid CORS cross-site issue, I got a little sad to be blocked there 😛
n
In the meantime, if you want to update the
VUE_APP_SERVER_URL
in your
.env
file, you can run
npm install
and
npm run build
on the repo to rebuild the application with your new endpoint
Note that those will require you to have Node and NPM installed
e
That’s fine I am in no rush since this is meant to be tried/poced in September/Q4
if you have a ticket tho I wouldn’t mind you posting it here so that I can follow it
n
Creating it as we speak 🙂