https://prefect.io logo
t

Tadej Boncelj

07/03/2023, 2:38 PM
Hey guys. I'm trying to setup the Prefect Self hosted Orion server, with Postgres database and agent all in each individual containers. So even though I've managed to setup the server, database and the agent, I somehow struggle to get deployments into the queue and actually start a flow. When I was doing on the local linux machine it seemed to work just fine, but I'm struggling now having them in Containers. Am I missing anything? This is my repository: And this is my docker-compose.yml:
version: "3.9"
services:
### Prefect Database
database:
container_name: database
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=orion
expose:
- 5432
volumes:
- db:/var/lib/postgresql/data
profiles: ["orion"]
### Prefect Orion API
orion:
container_name: orion
image: prefecthq/prefect:2-python3.10
restart: always
volumes:
- prefect:/root/.prefect
entrypoint: ["prefect", "orion", "start"]
environment:
- PREFECT_ORION_API_HOST=0.0.0.0
- PREFECT_API_URL=<http://127.0.01:4200/api>
- PREFECT_ORION_DATABASE_CONNECTION_URL=<postgresql+asyncpg://postgres:postgres@database:5432/orion>
ports:
- 4200:4200
depends_on:
- database
profiles: ["orion"]
## Prefect Agent
agent:
container_name: agent
image: prefecthq/prefect:2-python3.10
restart: always
entrypoint: ["prefect", "agent", "start", "-q", "default"]
volumes:
- "./src:/root/src"
environment:
- PREFECT_API_URL=<http://orion:4200/api>
depends_on:
- orion
profiles: ["agent"]
cli:
image: prefecthq/prefect:2.10.17-python3.11
entrypoint: "bash"
working_dir: "/root/flows"
volumes:
- "./flows:/root/flows"
environment:
- PREFECT_API_URL=<http://server:4200/api>
#       Use PREFECT_API_KEY to use the CLI to interact with Prefect Cloud
#     - PREFECT_API_KEY=YOUR_API_KEY
profiles: ["cli"]
volumes:
prefect:
db:
networks:
default:
name: prefect-network
2 Views