Netanel Malka
02/22/2024, 9:33 AMMarvin
02/22/2024, 9:40 AMdocker-compose
example for running Prefect 2 for test purposes as test containers. However, they do provide some guidance on how to set up a Docker container to communicate with the Prefect API:
To ensure flow containers can communicate with the Prefect API, you should set the PREFECT_API_URL
environment variable. Here are some examples depending on your system:
- On non-Linux systems:
docker run -e PREFECT_API_URL=<http://host.docker.internal:4200/api> your-image-name
- On Linux systems:
docker run --network="host" -e PREFECT_API_URL=<http://localhost:4200/api> your-image-name
For more details, you can visit Prefect Docker Guide.
Remember, you may have to write your own docker-compose.yml
file based on your specific testing needs by setting the appropriate environment variables and networking configurations as guided above.