Update docker-compose.yaml
This commit is contained in:
parent
0e42fd07c0
commit
41a2a7c84b
1 changed files with 9 additions and 29 deletions
|
|
@ -10,52 +10,32 @@ services:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
git_sync:
|
|
||||||
container_name: airflow_git_sync
|
|
||||||
image: registry.k8s.io/git-sync/git-sync:v3.6.7
|
|
||||||
environment:
|
|
||||||
GIT_SYNC_REPO: ${GIT_REPO_URL}
|
|
||||||
GIT_SYNC_BRANCH: main
|
|
||||||
GIT_SYNC_ROOT: /git
|
|
||||||
GIT_SYNC_DEST: repo
|
|
||||||
GIT_SYNC_WAIT: 30
|
|
||||||
GIT_SYNC_ONE_TIME: "false"
|
|
||||||
volumes:
|
|
||||||
- airflow_git:/git
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
airflow:
|
airflow:
|
||||||
container_name: airflow_container
|
container_name: airflow_container
|
||||||
image: apache/airflow:3.1.3
|
image: apache/airflow:3.1.3
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
environment:
|
environment:
|
||||||
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||||
AIRFLOW__WEBSERVER__DEFAULT_USER_USERNAME: ${AIRFLOW_ADMIN_USER}
|
|
||||||
AIRFLOW__WEBSERVER__DEFAULT_USER_PASSWORD: ${AIRFLOW_ADMIN_PASSWORD}
|
|
||||||
AIRFLOW__CORE__LOAD_EXAMPLES: "false"
|
AIRFLOW__CORE__LOAD_EXAMPLES: "false"
|
||||||
AIRFLOW__CORE__EXECUTOR: LocalExecutor
|
AIRFLOW__CORE__EXECUTOR: LocalExecutor
|
||||||
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "true"
|
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "true"
|
||||||
|
AIRFLOW__CORE__DAGS_FOLDER: /opt/airflow/dags
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- git_sync
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- airflow_git:/opt/airflow/gitrepo
|
- ./airflow/dags:/opt/airflow/dags
|
||||||
- airflow_logs:/opt/airflow/logs
|
- ./airflow/logs:/opt/airflow/logs
|
||||||
- airflow_plugins:/opt/airflow/plugins
|
- ./airflow/plugins:/opt/airflow/plugins
|
||||||
|
|
||||||
command: >
|
command: >
|
||||||
bash -c "
|
bash -c "
|
||||||
airflow db migrate &&
|
airflow db migrate &&
|
||||||
mkdir -p /opt/airflow/dags &&
|
|
||||||
ln -s /opt/airflow/gitrepo/repo/airflow/airflow/dags/* /opt/airflow/dags/ &&
|
|
||||||
airflow scheduler &
|
airflow scheduler &
|
||||||
exec airflow webserver --port 3000
|
exec airflow api-server --port 8080
|
||||||
"
|
"
|
||||||
|
ports:
|
||||||
|
- "8000:8080"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
airflow_git:
|
|
||||||
airflow_logs:
|
airflow_logs:
|
||||||
airflow_plugins:
|
airflow_plugins:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue