removed gitsync
This commit is contained in:
parent
5ec0941dc7
commit
a6cce866d3
1 changed files with 9 additions and 37 deletions
|
|
@ -2,8 +2,6 @@ services:
|
|||
db:
|
||||
container_name: postgres_container
|
||||
image: postgres:15.15
|
||||
ports:
|
||||
- 5000:5432
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
|
|
@ -12,58 +10,32 @@ services:
|
|||
- postgres_data:/var/lib/postgresql/data
|
||||
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:
|
||||
container_name: airflow_container
|
||||
image: apache/airflow:3.1.3
|
||||
ports:
|
||||
- ${AIRFLOW_PORT}:8080
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
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__EXECUTOR: LocalExecutor
|
||||
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "true"
|
||||
|
||||
depends_on:
|
||||
- db
|
||||
- git_sync
|
||||
|
||||
# Mount ONLY the folder where your DAGs are inside the git repo
|
||||
AIRFLOW__CORE__DAGS_FOLDER: /opt/airflow/dags
|
||||
volumes:
|
||||
- airflow_git:/opt/airflow/gitrepo
|
||||
- airflow_logs:/opt/airflow/logs
|
||||
- airflow_plugins:/opt/airflow/plugins
|
||||
|
||||
# We symlink your DAG directory inside entrypoint
|
||||
- ./airflow/dags:/opt/airflow/dags
|
||||
- ./airflow/logs:/opt/airflow/logs
|
||||
- ./airflow/plugins:/opt/airflow/plugins
|
||||
command: >
|
||||
bash -c "
|
||||
airflow db migrate &&
|
||||
mkdir -p /opt/airflow/dags &&
|
||||
ln -s /opt/airflow/gitrepo/repo/airflow/airflow/dags/* /opt/airflow/dags/ &&
|
||||
airflow scheduler &
|
||||
exec airflow webserver
|
||||
exec airflow api-server --port 8080
|
||||
"
|
||||
ports:
|
||||
- "8000:8080"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
airflow_git:
|
||||
airflow_logs:
|
||||
airflow_plugins:
|
||||
|
|
|
|||
Loading…
Reference in a new issue