A Docker image based on Apache Airflow. Airflow is a platform to programmatically author, schedule, and monitor workflows.
With the default configuration scripts this image:
- Supports Sequential, Local, Celery and Dask executors
- Supports single node execution (webserver and scheduler on the same container)
- Supports MySQL and Postgres backends
- Supports all the RabbitMQ and Redis as Celery backends
$ docker run --rm z0beat/airflow
With this command you get the Airflow version used on this image.
This repository contains some example compose files to run Airflow with different configurations.
$ docker-compose -f docker-compose-sequential-sqlite.yml up -d
$ docker-compose -f docker-compose-local-mysql.yml up -d
$ docker-compose -f docker-compose-local-postgres.yml up -d
$ docker-compose -f docker-compose-dask-mysql.yml up -d
$ docker-compose -f docker-compose-celery-mysql-redis.yml up -d
$ docker-compose -f docker-compose-celery-mysql-rabbitmq.yml up -d
To configure Airflow, this image, run the scripts located on /opt/airflow.d
inside container. The default scripts provides the ability to configure the application using environment variables.
Supported variables with default scripts:
- SINGLE_NODE: (True|False) Runs initdb and scheduler on background on background.
- INITDB: (True|False) Runs initdb before run CMD on container
- START_DELAY: (in seconds, 1) Runs a sleep with START_DELAY to prevent race conditions with the initdb commands.
- EXECUTOR: Executor used by Airflow
- SequentialExecutor
- LocalExecutor
- CeleryExecutor
- DaskExecutor
- BACKEND: Backend used by Airflow
- sqlite
- mysql
- postgres
Variables only used if mysql or postgres backends are selected.
- BACKEND_USER
- BACKEND_PASSWORD
- BACKEND_DATABASE
- BACKEND_HOST
- BACKEND_PORT
Variables only used if CeleryExecutor is selected.
- BROKER: Broker used by Celery
- redis
- rabbitq
- CELERY_BACKEND: Backend used by Celery (defaults to BACKEND)
- mysql
- postgres
- CELERY_BROKER_USER
- CELERY_BROKER_PASSWORD
- CELERY_BROKER_HOST
- CELERY_BROKER_PORT
This variables defaults to BACKEND_* values
- CELERY_BACKEND_USER
- CELERY_BACKEND_PASSWORD
- CELERY_BACKEND_DATABASE
- CELERY_BACKEND_HOST
- CELERY_BACKEND_PORT
Variables only used if DaskExecutor is selected.
- DASK_HOST
- DASK_PORT
As mentioned before, this image run the scripts from /opt/airflow.d
to configure the application. This behaviour gives you the ability of run your own configuration scripts if you mount a volume.
To disable the auto configuration with the scripts mentioned above, you can set the variable AIRFLOW_AUTOCONF=False
.
You can also change the path of the configuration scripts modifying the variable AIRFLOW_CONF
.