-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
70 lines (63 loc) · 1.86 KB
/
docker-compose.yaml
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
version: "3.4"
name: prefect
x-prefect-common: &prefect-common
build:
context: .
networks:
- prefect
restart: always
services:
server:
<<: *prefect-common
command: prefect server start --host server --port 4200
depends_on:
- database
environment:
PREFECT_API_DATABASE_CONNECTION_URL: "postgresql+asyncpg://postgres:postgres@database:5432/prefect"
healthcheck:
test: ["CMD", "curl", "-f", "http://server:4200/api/health"]
start_interval: 5s
start_period: 15s
ports:
- "127.0.0.1:4200:4200"
docker-worker:
<<: *prefect-common
command: prefect worker start --with-healthcheck --pool docker --type docker
depends_on:
server:
condition: service_healthy
environment:
PREFECT_API_URL: "http://server:4200/api"
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health"]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
process-worker:
<<: *prefect-common
command: prefect worker start --with-healthcheck --pool process --type process
depends_on:
server:
condition: service_healthy
environment:
PREFECT_API_URL: "http://server:4200/api"
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health"]
database:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=prefect
expose:
- 5432
networks:
- prefect
restart: always
volumes:
- db:/var/lib/postgresql/data
volumes:
db:
name: prefect-db
networks:
prefect:
name: prefect