-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
89 lines (83 loc) · 2.26 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
services:
postgres:
image: postgres:15
environment:
POSTGRES_USER: prefect
POSTGRES_PASSWORD: prefect
POSTGRES_DB: prefect
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "prefect"]
interval: 5s
retries: 5
redis:
image: redis:7
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
retries: 5
prefect-server:
image: prefecthq/prefect:2-latest
restart: always
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
- PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://prefect:prefect@postgres:5432/prefect
- PREFECT_API_URL=http://prefect-server:4200/api
- PREFECT_REDIS_URL=redis://redis:6379/0
ports:
- "4200:4200"
command: prefect server start --host 0.0.0.0
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4200/api/health')"]
interval: 3s
timeout: 5s
retries: 5
start_period: 10s
prefect-worker:
image: prefecthq/prefect:2-latest
restart: always
depends_on:
prefect-server:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
- PREFECT_API_URL=http://prefect-server:4200/api
volumes:
- ${PWD}:/opt/prefect/project
working_dir: /opt/prefect/project
command: >
bash -c 'pip install -e . && prefect worker start --pool "default-pool" --work-queue "default"'
healthcheck:
test: ["CMD-SHELL", "prefect work-pool inspect default-pool | grep -i 'status.*ready'"]
interval: 3s
timeout: 10s
retries: 5
start_period: 10s
mongodb:
image: mongo:6
environment:
MONGO_INITDB_ROOT_USERNAME: article_user
MONGO_INITDB_ROOT_PASSWORD: article_password
ports:
- "27017:27017"
volumes:
- mongodb-data:/data/db
restart: always
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
postgres-data:
mongodb-data:
networks:
default:
name: orchestration-network