A simple Apache Airflow environment using Docker and Docker Compose.
- Clone this repository to a directory of your choice.
- Move to the
docker-airflow
directory - Switch branches according to the repository DB type
- SQLite: Use the
main
branch - PostgreSQL: Use the
repos-postgres
branch - MySQL: Use the
repos-mysql
branch
- SQLite: Use the
- Change the command in the
webserver
container todb init
- Run
docker-compose up
to initialize the DB and exit withCtrl + C
when complete - Change the command in the
webserver
container towebserver
- Run
docker-compose up -d
- Create an Airflow admin user
- Access
http://127.0.0.1:8080
with a web browser and log in to Airflow
You can create a user by running the Airflow CLI in the webserver
container as shown below.
docker-compose run --rm webserver airflow users create \
--username admin \
--firstname Peter \
--lastname Parker \
--role Admin \
--email spiderman@superhero.org
For more information on the command, see the official Apache Airflow documentation.