This repository provides a Dockerfile and instructions to set up an Apache Airflow instance using Docker. Apache Airflow is a platform used to programmatically author, schedule, and monitor workflows.
The provided Dockerfile allows you to create a Docker image containing Apache Airflow along with Helm and other dependencies. Here's a breakdown of what the Dockerfile does:
- Use an official Python image as the base (
python:3.8-slim). - Set environment variables:
AIRFLOW_HOME: The directory where Airflow configuration and DAGs will be stored.AIRFLOW__CORE__LOAD_EXAMPLES: Disable loading example DAGs.
- Install
apache-airflowusingpip. - Install
Helmand other required dependencies usingapt-get. - Create a directory for Airflow DAGs.
- Initialize the Airflow database using
airflow db init. - Expose port 8080 for the Airflow web interface.
- Start the Airflow webserver.
To deploy your Apache Airflow instance using this Dockerfile, follow these steps:
-
Build the Docker Image: In your terminal, navigate to the directory containing the Dockerfile and run:
docker build -t airflow-container .This will build a Docker image named airflow-container.
-
Run the Docker Container: After building the image, run the following command to start the container:
docker run -p 8080:8080 airflow-containerThis will start the Airflow webserver, accessible at http://localhost:8080
-
Access the Airflow Web Interface: Open your web browser and navigate to http://localhost:8080 to access the Airflow web interface. You can configure and manage your workflows from here.
DAGs: Add your custom DAGs by placing them in the dags directory within your AIRFLOW_HOME directory. Configuration: Customize your Airflow configuration by editing the necessary Airflow configuration files.
This Dockerfile and setup are intended for development and testing purposes. For production deployments, consider implementing appropriate security measures and optimizations.