-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
161 lines (151 loc) · 4.13 KB
/
docker-compose.yml
File metadata and controls
161 lines (151 loc) · 4.13 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
version: "3.9"
x-airflow-common: &airflow-common
build:
context: .
dockerfile: airflow.Dockerfile
env_file:
- .env
environment: &airflow-env
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://finsight:finsight@postgres/airflow
AIRFLOW__CORE__FERNET_KEY: ""
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: "false"
AIRFLOW__CORE__LOAD_EXAMPLES: "false"
AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
AIRFLOW_CONN_FINSIGHT_POSTGRES: postgresql://finsight:finsight@postgres/finsight
AIRFLOW_CONN_FINSIGHT_S3: aws://minio:minio123@?endpoint_url=http%3A%2F%2Fminio%3A9000
DATABASE_URL: postgresql://finsight:finsight@postgres/finsight
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_BUCKET: finsight
MINIO_USE_SSL: "false"
volumes:
- ./dags:/opt/airflow/dags
- ./finsight:/opt/airflow/finsight
- airflow-logs:/opt/airflow/logs
depends_on:
postgres:
condition: service_healthy
services:
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: finsight
POSTGRES_PASSWORD: finsight
POSTGRES_DB: finsight
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./scripts/init_airflow_db.sql:/docker-entrypoint-initdb.d/init_airflow_db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U finsight"]
interval: 5s
timeout: 5s
retries: 10
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- "8081:8080"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 5
depends_on:
postgres:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
airflow-scheduler:
<<: *airflow-common
command: scheduler
depends_on:
postgres:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
airflow-init:
<<: *airflow-common
restart: "no"
command: >
bash -c "
airflow db init &&
airflow users create --username admin --password admin --firstname Admin --lastname User --role Admin --email admin@example.com || true
"
finsight-init:
build:
context: .
dockerfile: Dockerfile
command: bash /app/scripts/docker-init.sh
environment:
DATABASE_URL: postgresql://finsight:finsight@postgres/finsight
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_BUCKET: finsight
MINIO_USE_SSL: "false"
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
env_file:
- .env
restart: "no"
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://finsight:finsight@postgres/finsight
REDIS_URL: redis://redis:6379
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_BUCKET: finsight
AIRFLOW_API_URL: http://airflow-webserver:8080/api/v1
AIRFLOW_API_USER: admin
AIRFLOW_API_PASSWORD: admin
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
finsight-init:
condition: service_completed_successfully
env_file:
- .env
volumes:
pgdata:
miniodata:
airflow-logs: