-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdocker-compose.yml
83 lines (77 loc) · 2.48 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: "3.9"
services:
### Prefect Database
database:
image: postgres:15.2-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=prefect
expose:
- 5432
volumes:
- db:/var/lib/postgresql/data
profiles: ["server"]
### MinIO for flow storage
minio:
image: minio/minio:latest
entrypoint: ["minio", "server", "--address", "0.0.0.0:9000", "--console-address", "0.0.0.0:9001", "/data"]
volumes:
- "minio:/data"
ports:
- 9000:9000
- 9001:9001
profiles: ["minio"]
### Prefect Server API and UI
server:
image: prefecthq/prefect:2.11.5-python3.11
restart: always
volumes:
- prefect:/root/.prefect
entrypoint: ["/opt/prefect/entrypoint.sh", "prefect", "server", "start"]
environment:
- PREFECT_UI_URL=http://127.0.0.1:4200/api
- PREFECT_API_URL=http://127.0.0.1:4200/api
# If you want to access Prefect Server UI from anywhere other than the Docker host machine, you will need to change
# PREFECT_UI_URL and PREFECT_API_URL to match the external hostname/IP of the host machine. For example:
#- PREFECT_UI_URL=http://external-ip:4200/api
#- PREFECT_API_URL=http://external-ip:4200/api
- PREFECT_SERVER_API_HOST=0.0.0.0
- PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://postgres:postgres@database:5432/prefect
# Uncomment the following line if you want to use the 'S3 Bucket' storage block instead of the older 'S3' storage
# - EXTRA_PIP_PACKAGES=prefect-aws
ports:
- 4200:4200
depends_on:
- database
profiles: ["server"]
## Prefect Agent
agent:
image: prefecthq/prefect:2.11.5-python3.11
restart: always
entrypoint: ["/opt/prefect/entrypoint.sh", "prefect", "agent", "start", "-q", "YOUR_WORK_QUEUE_NAME"]
environment:
- PREFECT_API_URL=http://server:4200/api
# Use PREFECT_API_KEY if connecting the agent to Prefect Cloud
# - PREFECT_API_KEY=YOUR_API_KEY
profiles: ["agent"]
### Prefect CLI
cli:
image: prefecthq/prefect:2.11.5-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:
minio:
networks:
default:
name: prefect-network