Фикс сборки airflow
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# PostgreSQL for Airflow metadata
|
||||
postgres-metadata:
|
||||
@@ -44,6 +42,7 @@ services:
|
||||
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
|
||||
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres-metadata:5432/airflow
|
||||
AIRFLOW__CORE__EXECUTOR: LocalExecutor
|
||||
AIRFLOW__WEBSERVER__SECRET_KEY: replace-me-with-random-string
|
||||
command: >
|
||||
bash -c "
|
||||
airflow webserver
|
||||
@@ -67,6 +66,7 @@ services:
|
||||
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
|
||||
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres-metadata:5432/airflow
|
||||
AIRFLOW__CORE__EXECUTOR: LocalExecutor
|
||||
AIRFLOW__WEBSERVER__SECRET_KEY: replace-me-with-random-string
|
||||
command: >
|
||||
bash -c "
|
||||
airflow scheduler
|
||||
@@ -83,17 +83,23 @@ services:
|
||||
# Airflow init to create admin user
|
||||
airflow-init:
|
||||
build: .
|
||||
user: "0:0"
|
||||
# image: airflow-optimized:2.9.2
|
||||
environment:
|
||||
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
|
||||
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres-metadata:5432/airflow
|
||||
AIRFLOW__WEBSERVER__SECRET_KEY: replace-me-with-random-string
|
||||
volumes:
|
||||
- ./dags:/opt/airflow/dags
|
||||
- ./data:/opt/airflow/data
|
||||
command: >
|
||||
bash -c "
|
||||
airflow db migrate &&
|
||||
airflow users create --username admin --password admin --firstname Admin --lastname User --role Admin --email admin@example.org
|
||||
bash -ceuo pipefail "
|
||||
mkdir -p /opt/airflow/data &&
|
||||
chmod -R 777 /opt/airflow/data || true &&
|
||||
chown -R airflow:0 /opt/airflow/data || true &&
|
||||
umask 000 &&
|
||||
su -s /bin/bash airflow -c 'airflow db migrate' &&
|
||||
su -s /bin/bash airflow -c 'airflow users create --username admin --password admin --firstname Admin --lastname User --role Admin --email admin@example.org'
|
||||
"
|
||||
depends_on:
|
||||
postgres-metadata:
|
||||
|
||||
Reference in New Issue
Block a user