-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
71 lines (67 loc) · 2.06 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
version: "3.7"
services:
### Prefect Database
database:
image: postgres:15.2-alpine
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-prefect}
expose:
- 5432
volumes:
- db_postgres:/var/lib/postgresql/data
### Prefect Server API and UI
server:
image: python_prefect_dbt
restart: always
volumes:
- prefect:/root/.prefect
- .:${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
entrypoint:
[
"prefect",
"server",
"start",
"--host",
"0.0.0.0",
"--port",
"4200"
]
environment:
- PREFECT_ORION_API_HOST=${PREFECT_ORION_API_HOST:-127.0.0.1}
- PREFECT_ORION_API_PORT=${PREFECT_ORION_API_PORT:-4200}
- PREFECT_ORION_UI_API_URL=${PREFECT_ORION_UI_API_URL:-http://127.0.0.1:4200/api}
- PREFECT_API_DATABASE_CONNECTION_URL=${PREFECT_API_DATABASE_CONNECTION_URL:-postgresql+asyncpg://postgres:postgres@database:5432/prefect}
- PREFECT_LOCAL_STORAGE_PATH=${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
ports:
- 4200:4200
depends_on:
- database
## Prefect Agent
agent:
image: python_prefect_dbt
restart: always
volumes:
- .:${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
entrypoint: [ "prefect", "agent", "start", "-q", "default" ]
environment:
- PREFECT_API_URL=http://server:4200/api
- PREFECT_LOCAL_STORAGE_PATH=${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
# job
job:
image: python_prefect_dbt
entrypoint: [ "python3" ]
working_dir: ${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
volumes:
- .:${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
environment:
- PREFECT_API_URL=http://server:4200/api
- PREFECT_LOCAL_STORAGE_PATH=${PREFECT_LOCAL_STORAGE_PATH:-/root/github-data-pipeline}
volumes:
prefect:
db_postgres:
networks:
default:
name: prefect-network