Sophia Ponte
07/18/2024, 12:03 AMMarvin
07/18/2024, 12:03 AMbash
docker run -d --name prefect-postgres -v prefectdb:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=yourTopSecretPassword -e POSTGRES_DB=prefect postgres:latest
2. Set up and Run Prefect Server:
First, configure the Prefect API URL:
bash
prefect config set PREFECT_API_URL="<http://127.0.0.1:4200/api>"
Then, you can start the server with:
bash
docker run -d --name prefect-server -p 4200:4200 prefecthq/prefect:2.14.14
### Running Prefect Worker in Docker
1. Set Up and Run Prefect Worker:
First, set up a work pool in your UI if you haven't already:
bash
prefect work-pool create my-docker-pool
Then, start a worker referencing that pool:
bash
docker run -d --name prefect-worker prefecthq/prefect:2.14.14 prefect worker start --pool my-docker-pool
Note: Don't forget to verify the connections and ensure you can see the work pool in your Prefect UI.
For more detailed references, you can check:
- Running Prefect Server
- Running Prefect Workers
Does this help you get started?