updated docker setup and airflow

This commit is contained in:
Cameron Seamons 2025-12-10 20:10:17 -07:00
parent 34288dcbbe
commit 47a5e249c9
1270 changed files with 1022 additions and 3 deletions

View file

@ -0,0 +1,29 @@
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime, timedelta
def my_task():
print("Hello Airflow! Task 2 is running.")
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
with DAG(
'example_dag',
default_args=default_args,
description='My second DAG',
start_date=datetime(2025, 12, 10),
schedule=timedelta(minutes=3),
catchup=False,
) as dag:
task1 = PythonOperator(
task_id='print_hello',
python_callable=my_task
)
task1

View file

@ -10,20 +10,37 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
af:
airflow:
container_name: airflow_container
image: apache/airflow:3.1.3
ports:
- ${AIRFLOW_PORT}:8080
environment:
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@db:5432/airflow
# Database connection
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
# Custom admin credentials
AIRFLOW__WEBSERVER__DEFAULT_USER_USERNAME: ${AIRFLOW_ADMIN_USER}
AIRFLOW__WEBSERVER__DEFAULT_USER_PASSWORD: ${AIRFLOW_ADMIN_PASSWORD}
# Airflow config
AIRFLOW__CORE__LOAD_EXAMPLES: "false"
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "true"
depends_on:
- db
volumes:
- ./airflow/dags:/opt/airflow/dags
- ./airflow/logs:/opt/airflow/logs
- ./airflow/plugins:/opt/airflow/plugins
command: >
bash -c "airflow db migrate && airflow standalone"
bash -c "airflow db migrate && airflow scheduler & exec airflow webserver"
restart: unless-stopped
volumes:
postgres_data:
airflow_logs:
airflow_plugins:

View file

@ -0,0 +1 @@
15

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

View file

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

View file

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Some files were not shown because too many files have changed in this diff Show more