Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (53 loc) · 1.64 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (53 loc) · 1.64 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
services:
postgres:
image: postgres:16
container_name: postgres
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_MULTIPLE_DATABASES: airflow,bookops
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/multiple_postgres.sh:/docker-entrypoint-initdb.d/multiple-databases.sh
airflow:
image: apache/airflow:3.2.1-python3.14
container_name: airflow
depends_on:
- postgres
environment:
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg://airflow:airflow@postgres:5432/airflow
AIRFLOW_CONN_BOOKSHOP_POSTGRES: postgresql://airflow:airflow@postgres:5432/bookops
AIRFLOW__API_AUTH__JWT_SECRET: bookshop-workshop-jwt-secret
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "True"
AIRFLOW_UID: "50000"
PYTHONPATH: /opt/airflow
AIRFLOW_HOME: /opt/airflow
_AIRFLOW_WWW_USER_USERNAME: airflow
_AIRFLOW_WWW_USER_PASSWORD: airflow
_PIP_ADDITIONAL_REQUIREMENTS: apache-airflow-providers-postgres==6.3.0 httpx==0.28.1 psycopg==3.2.9
command: >
bash -lc "
export AIRFLOW_HOME=/opt/airflow &&
airflow db migrate &&
airflow standalone
"
ports:
- "${AIRFLOW_PORT:-8080}:8080"
volumes:
- ./:/opt/airflow
analytics:
build: ./analytics-app
depends_on:
- postgres
environment:
BOOKOPS_DB_URL: postgresql://airflow:airflow@postgres:5432/bookops
ports:
- "8501:8501"
volumes:
- ./analytics-app:/app
volumes:
postgres_data: