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

[fix](doc)Fix Docker Compose up Airflow init command #39301

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 11 additions & 11 deletions docs/apache-airflow/howto/docker-compose/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This file contains several service definitions:
- ``postgres`` - The database.
- ``redis`` - `The redis <https://redis.io/>`__ - broker that forwards messages from scheduler to worker.

Optionally, you can enable flower by adding ``--profile flower`` option, e.g. ``docker compose --profile flower up``, or by explicitly specifying it on the command line e.g. ``docker compose up flower``.
Optionally, you can enable flower by adding ``--profile flower`` option, e.g. ``docker-compose --profile flower up``, or by explicitly specifying it on the command line e.g. ``docker-compose up flower``.
Copy link
Contributor

@eladkal eladkal Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker-compose is obsolete
Please see #28747 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker-compose is obsolete

We are currently using Docker Compose. Thank you for your correction


- ``flower`` - `The flower app <https://flower.readthedocs.io/en/latest/>`__ for monitoring the environment. It is available at ``http://localhost:5555``.

Expand Down Expand Up @@ -149,7 +149,7 @@ On **all operating systems**, you need to run database migrations and create the

.. code-block:: bash

docker compose up airflow-init
docker-compose up airflow-init

After initialization is complete, you should see a message like this:

Expand All @@ -171,7 +171,7 @@ up and restart from scratch.

The best way to do this is to:

* Run ``docker compose down --volumes --remove-orphans`` command in the directory you downloaded the
* Run ``docker-compose down --volumes --remove-orphans`` command in the directory you downloaded the
``docker-compose.yaml`` file
* Remove the entire directory where you downloaded the ``docker-compose.yaml`` file
``rm -rf '<DIRECTORY>'``
Expand All @@ -184,7 +184,7 @@ Now you can start all services:

.. code-block:: bash

docker compose up
docker-compose up

.. note::
docker-compose is old syntax. Please check `Stackoverflow <https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose>`__.
Expand Down Expand Up @@ -218,7 +218,7 @@ You can also run :doc:`CLI commands <../usage-cli>`, but you have to do it in on

.. code-block:: bash

docker compose run airflow-worker airflow info
docker-compose run airflow-worker airflow info

If you have Linux or Mac OS, you can make your work easier and download a optional wrapper scripts that will allow you to run commands with a simpler command.

Expand Down Expand Up @@ -279,17 +279,17 @@ To stop and delete containers, delete volumes with database data and download im

.. code-block:: bash

docker compose down --volumes --rmi all
docker-compose down --volumes --rmi all

Using custom images
===================

When you want to run Airflow locally, you might want to use an extended image, containing some additional dependencies - for
example you might add new python packages, or upgrade airflow providers to a later version. This can be done very easily
by specifying ``build: .`` in your ``docker-compose.yaml`` and placing a custom Dockerfile alongside your
``docker-compose.yaml``. Then you can use ``docker compose build`` command
to build your image (you need to do it only once). You can also add the ``--build`` flag to your ``docker compose`` commands
to rebuild the images on-the-fly when you run other ``docker compose`` commands.
``docker-compose.yaml``. Then you can use ``docker-compose build`` command
to build your image (you need to do it only once). You can also add the ``--build`` flag to your ``docker-compose`` commands
to rebuild the images on-the-fly when you run other ``docker-compose`` commands.

Examples of how you can extend the image with custom providers, python packages,
apt packages and more can be found in :doc:`Building the image <docker-stack:build>`.
Expand Down Expand Up @@ -337,8 +337,8 @@ that conflicts with the version of apache-airflow that you are using.

3) Place ``requirements.txt`` file in the same directory.

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.
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
==========================================
Expand Down