Update docker-compose.yaml
This commit is contained in:
@@ -15,6 +15,7 @@ services:
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
- PYTHONPATH=/opt/airflow # Kunci agar folder scripts terbaca
|
||||
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres/airflow
|
||||
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
|
||||
- AIRFLOW__CORE__LOAD_EXAMPLES=False
|
||||
@@ -22,9 +23,9 @@ services:
|
||||
- airflow_dags:/opt/airflow/dags
|
||||
- airflow_logs:/opt/airflow/logs
|
||||
- airflow_plugins:/opt/airflow/plugins
|
||||
- airflow_scripts:/opt/airflow/scripts
|
||||
ports:
|
||||
- "8081:8080"
|
||||
# Perintah di bawah akan inisialisasi DB dulu baru menyalakan webserver
|
||||
command: bash -c "airflow db init && airflow webserver"
|
||||
|
||||
airflow-scheduler:
|
||||
@@ -33,17 +34,19 @@ services:
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
- PYTHONPATH=/opt/airflow
|
||||
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres/airflow
|
||||
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
|
||||
volumes:
|
||||
- airflow_dags:/opt/airflow/dags
|
||||
- airflow_logs:/opt/airflow/logs
|
||||
- airflow_plugins:/opt/airflow/plugins
|
||||
# Scheduler menunggu webserver selesai init DB
|
||||
- airflow_scripts:/opt/airflow/scripts
|
||||
command: scheduler
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
airflow_dags:
|
||||
airflow_logs:
|
||||
airflow_plugins:
|
||||
airflow_plugins:
|
||||
airflow_scripts:
|
||||
Reference in New Issue
Block a user