-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
118 lines (112 loc) · 3.54 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
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
version: '3'
x-airflow-common:
&airflow-common
image: ${AIRFLOW_IMAGE_NAME:-registry.gitlab.com/lappis-unb/decidimbr/servicos-de-dados/airflow-dags:latest}
build:
context: ..
dockerfile: airflow-docker/dockerfile
target: airflow-local
environment:
&airflow-common-env
AIRFLOW__CORE__DEFAULT_TIMEZONE: 'America/Sao_Paulo'
AIRFLOW__CORE__ENABLE_XCOM_PICKLING: 'true'
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
AIRFLOW__CORE__FERNET_KEY: ${AIRFLOW__CORE__FERNET_KEY}
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRES_USER:-airflow}:${POSTGRES_PASSWORD:-airflow}@postgres/${POSTGRES_DB:-airflow}
AIRFLOW__EMAIL__DEFAULT_EMAIL_ON_RETRY: 'false'
AIRFLOW__EMAIL__DEFAULT_EMAIL_ON_FAILURE: 'false'
AIRFLOW__WEBSERVER__DEFAULT_UI_TIMEZONE: 'America/Sao_Paulo'
AIRFLOW__WEBSERVER__INSTANCE_NAME: "Lappis - Local Dev Env!"
AIRFLOW__WEBSERVER__NAVBAR_COLOR: '#98DFFF'
AIRFLOW__WEBSERVER__SECRET_KEY: '42'
AIRFLOW__CORE__TEST_CONNECTION: Enabled
PYTHONPATH: '${AIRFLOW_HOME}/dags/airflow-dags:${AIRFLOW_HOME}/plugins'
volumes:
# cluster policy config
- ./config/airflow_local_settings.py:${AIRFLOW_HOME}/config/airflow_local_settings.py
# dags
- ../airflow-dags/dags:${AIRFLOW_HOME}/dags/airflow-dags
# Plugins
- ../airflow-dags/plugins:${AIRFLOW_HOME}/plugins/plugins
# Jupyter
- ../jupyter-notebooks/:/opt/airflow/notebooks
# logs
#- ./mnt/logs:${AIRFLOW_HOME}/logs
# - ./mnt/dags-data:${AIRFLOW_HOME}/dags-data
user: "${AIRFLOW_UID:-50000}:0"
depends_on:
&airflow-common-depends-on
postgres:
condition: service_healthy
services:
postgres:
build:
context: .
dockerfile: ./db/dockerfile
env_file:
- .env
volumes:
- ${DB_VOLUME}
ports:
- 25570:5432
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 10s
timeout: 60s
start_period: 60s
retries: 5
restart: always
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- 8080:8080
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 10s
timeout: 60s
start_period: 60s
retries: 5
restart: always
environment:
<<: *airflow-common-env
_AIRFLOW_DB_MIGRATE: 'true'
_AIRFLOW_WWW_USER_CREATE: 'true'
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow}
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
airflow-scheduler:
<<: *airflow-common
command: scheduler
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8974/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-webserver:
condition: service_healthy
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./mnt/minio:/data
environment:
MINIO_ROOT_USER: lappis
MINIO_ROOT_PASSWORD: lappisrocks
command: server --console-address ":9001" /data
jupyter:
<<: *airflow-common
command: bash -c "jupyter lab --port=8888 --no-browser --ip=0.0.0.0 --notebook-dir=/opt/airflow/notebooks --ServerApp.token=''"
environment:
<<: *airflow-common-env
PUID: 1001 # Replace with your UID
PGID: 1001 # Replace with your GID
ports:
- 8888:8888