From 36cb20af218919bcd821688e91245ffbe3fcfc16 Mon Sep 17 00:00:00 2001 From: dominikhei <105610163+dominikhei@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:49:15 +0100 Subject: [PATCH] Added functionality to automatically ingest custom airflow.cfg file upon startup (#36289) --------- Co-authored-by: Andrey Anshin --- .../howto/docker-compose/docker-compose.yaml | 3 +++ docs/apache-airflow/howto/docker-compose/index.rst | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/apache-airflow/howto/docker-compose/docker-compose.yaml b/docs/apache-airflow/howto/docker-compose/docker-compose.yaml index 6af7d020fa867..9effc2d504ca2 100644 --- a/docs/apache-airflow/howto/docker-compose/docker-compose.yaml +++ b/docs/apache-airflow/howto/docker-compose/docker-compose.yaml @@ -69,6 +69,9 @@ x-airflow-common: # WARNING: Use _PIP_ADDITIONAL_REQUIREMENTS option ONLY for a quick checks # for other purpose (development, test and especially production usage) build/extend Airflow image. _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-} + # The following line can be used to set a custom config file, stored in the local config folder + # If you want to use it, outcomment it and replace airflow.cfg with the name of your config file + # AIRFLOW_CONFIG: '/opt/airflow/config/airflow.cfg' volumes: - ${AIRFLOW_PROJ_DIR:-.}/dags:/opt/airflow/dags - ${AIRFLOW_PROJ_DIR:-.}/logs:/opt/airflow/logs diff --git a/docs/apache-airflow/howto/docker-compose/index.rst b/docs/apache-airflow/howto/docker-compose/index.rst index 1533d0c8138ad..383a0f4c559df 100644 --- a/docs/apache-airflow/howto/docker-compose/index.rst +++ b/docs/apache-airflow/howto/docker-compose/index.rst @@ -340,6 +340,19 @@ that conflicts with the version of apache-airflow that you are using. Run ``docker compose build`` to build the image, or add ``--build`` flag to ``docker compose up`` or ``docker compose run`` commands to build the image automatically as needed. +Special case - Adding a custom config file +========================================== + +If you have a custom config file and wish to use it in your Airflow instance, you need to perform the following steps: + +1) Remove comment from the ``AIRFLOW_CONFIG: '/opt/airflow/config/airflow.cfg'`` line + in the ``docker-compose.yaml`` file. + +2) Place your custom ``airflow.cfg`` file in the local config folder. + +3) If your config file has a different name than ``airflow.cfg``, adjust the filename in + ``AIRFLOW_CONFIG: '/opt/airflow/config/airflow.cfg'`` + Networking ==========