Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to automatically ingest custom airflow.cfg file upon startup #36289

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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