Doug Applegate
10/09/2024, 9:29 PMservices:
server:
image: prefecthq/prefect:3.0.5-python3.12
restart: unless-stopped
volumes:
- prefect:/root/.prefect
entrypoint: ["prefect", "server", "start", "--host", "0.0.0.0"]
environment:
- PREFECT_LOGGING_SERVER_LEVEL=WARNING
- PREFECT_API_URL=<http://127.0.0.1:4200/api>
- PREFECT_API_DATABASE_CONNECTION_URL=${DATABASE_URL}
- PREFECT_API_DATABASE_ECHO=False
- PREFECT_API_DATABASE_MIGRATE_ON_START=True
ports:
- 4200:4200
postgres:
image: postgres:16.4
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: prefect
In 3.0.4 this seems to work fine, but in 3.0.5 it doesn't work when pulling up the page from somewhere else on the network (when I navigate to http://prefect.example.com:4200 for example) and the UI throws that error. I had to change PREFECT_API_URL to the host ip address (e.g. http://prefect.example.com:4200/api) to get this to work
I tried removing the ENV variable altogether as well and it throws the same error except it has 0.0.0.0 instead of 127.0.0.1. I'm wondering if I should raise it as an issue or should the proper configuration for PREFECT_API_URL inside a container be the host's name/ip? Thanks for the help.Alexander Azzam
10/09/2024, 9:32 PMNate
10/09/2024, 9:32 PMDoug Applegate
10/09/2024, 10:20 PMPREFECT_UI_API_URL=<http://prefect.example.com:4200/api>