-
Notifications
You must be signed in to change notification settings - Fork 44
/
docker-compose.yml
61 lines (54 loc) · 1.42 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
version: '3'
x-airflow-common:
&airflow-common
build:
context: .
dockerfile: Dockerfile
image: custom-airflow:2.7.1-python3.9
env_file:
- airflow.env
volumes:
- ./config:/opt/airflow/config
- ./dags:/opt/airflow/dags
- ./data:/opt/airflow/data
- ./etls:/opt/airflow/etls
- ./logs:/opt/airflow/logs
- ./pipelines:/opt/airflow/pipelines
- ./plugins:/opt/airflow/plugins
- ./tests:/opt/airflow/tests
- ./utils:/opt/airflow/utils
# - ./airflow.cfg:/opt/airflow/airflow.cfg
- ./requirements.txt:/opt/airflow/requirements.txt
depends_on:
- postgres
- redis
services:
postgres:
image: postgres:12
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: airflow_reddit
POSTGRES_PORT: 5432
ports:
- "5432:5432"
redis:
image: redis:latest
ports:
- "6379:6379"
airflow-init:
<<: *airflow-common
command: >
bash -c "pip install -r /opt/airflow/requirements.txt && airflow db init && airflow db upgrade && airflow users create --username admin --firstname admin --lastname admin --role Admin --email [email protected] --password admin"
restart: "no"
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- "8080:8080"
airflow-scheduler:
<<: *airflow-common
command: scheduler
airflow-worker:
<<: *airflow-common
command: celery worker