Skip to content

Commit

Permalink
Added functionality to automatically ingest custom airflow.cfg file u…
Browse files Browse the repository at this point in the history
…pon startup (#36289)


---------

Co-authored-by: Andrey Anshin <[email protected]>
  • Loading branch information
dominikhei and Taragolis authored Dec 19, 2023
1 parent aed3c92 commit 36cb20a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/apache-airflow/howto/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions docs/apache-airflow/howto/docker-compose/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========

Expand Down

0 comments on commit 36cb20a

Please sign in to comment.