Tadej Boncelj
07/03/2023, 2:38 PMversion: "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