-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
90 lines (84 loc) · 1.96 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
84
85
86
87
88
89
90
x-prefect-image: &prefect-image prefecthq/prefect:2.19.7-python3.12
services:
### Prefect Database
database:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: prefect
ports:
- 5432:5432
volumes:
- db:/var/lib/postgresql/data
networks:
- prefect-local
### 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"
]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- minio:/data
ports:
- 9000:9000
- 9001:9001
networks:
- prefect-local
### Prefect Server API and UI
server:
image: *prefect-image
restart: always
volumes:
- prefect:/root/.prefect
entrypoint:
[
"/opt/prefect/entrypoint.sh",
"prefect",
"server",
"start"
]
environment:
PREFECT_API_URL: "${BASE_URL}:4200/api"
PREFECT_SERVER_API_HOST: 0.0.0.0
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:postgres@database:5432/prefect
ports:
- 4200:4200
depends_on:
- database
networks:
- prefect-local
### Prefect worker
worker:
image: *prefect-image
restart: always
entrypoint: sh -c "prefect worker start --pool docker-pool --type docker --install-policy if-not-present"
environment:
PREFECT_API_URL: "http://server:4200/api"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- server
networks:
- prefect-local
### Define named volumes for data persistence
volumes:
prefect:
db:
minio:
### Define and create the 'prefect-local' network
networks:
prefect-local:
name: prefect-local