https://prefect.io logo
Title
m

Maximilian Schnieder

08/02/2022, 5:30 PM
Hi I am running prefect from a docker container and I want to connect it to the prefect server on my local pc. But how can I connect the api? If I use the docker IP 172.17.0.1:4200/api it does not work and refuses the connection.
1
c

Cole Murray

08/02/2022, 5:57 PM
You need to bind the container ports to your host port. If running from command line, using the “-p 4200:4200” flag in your “docker run” command. You can then access it from localhost:4200
:thank-you: 1
:gratitude-danke: 1
m

Maximilian Schnieder

08/03/2022, 8:52 AM
Ok thank you for your reply. So when I activate the port forwarding, I can use this command/config inside the Docker Container? RUN prefect config set PREFECT_API_URL=http://172.18.0.1:4200/api