This repository provides a ready-to-use Apache Airflow instance for local usage with Docker Compose.
airflow-demo-instance/
├── .env # Environment variables (UID, GID, Compose options, etc.)
├── Dockerfile # Custom Airflow image build (optional)
├── compose.yml # Main Docker Compose stack
├── compose.override.yml # Local overrides (ports, extra mounts, etc.)
├── requirements.txt # Additional Python dependencies installed at startup
├── dags/ # Your Airflow DAGs (.py files go here)
├── plugins/ # Airflow plugins (custom operators/hooks/providers)
├── logs/ # Airflow logs (mounted as a volume for persistence)
├── config/ # Airflow configs (default airflow.cfg)
├── data/ # Data/artifacts used by DAGs (mounted inside containers)
└── run-airflow.sh # Launch script
Prerequisites:
- Docker (Engine) + Docker Compose (either the
docker composeplugin ordocker-composebinary) - Linux/macOS/WSL2
- Run Airflow
./run-airflow.shThe script:
-
initializes
AIRFLOW_UIDandAIRFLOW_GIDwith your current user/group IDs, -
performs a
pull/buildif needed, -
starts the services in detached mode (
up -d), -
shows the status and reminds you of useful commands.
-
stop Airflow
./stop-airflow.shOnce running, the Airflow web interface is usually available at:
(The exact port depends on your compose.yml.)
The decoder tasks rely on the MATLAB Runtime. With this local Airflow setup, you can run the processing chain in two different modes depending on how the MATLAB Runtime is made available:
If MATLAB Runtime is already installed locally on your machine, Airflow can directly access it through a bind mount from the host into the Airflow containers.
In this case, the compose.override.yml mounts the host path (e.g. /opt/matlab/runtime) into /opt/matlab/runtime inside the containers.
To launch in this mode, simply run:
./run-airflow-local-matlab.sh /absolute-path-to/matlab/runtime/R202XX/!\ The Docker image containing MATLAB is 15 GB /!\
If MATLAB Runtime is not available on the host, an additional container can be started.
This container embeds the official MATLAB Runtime image and exposes it through a Docker volume.
Airflow services then reuse this volume, so the DAGs see exactly the same path (/opt/matlab/runtime) as in the host-based mode.
To launch in this mode, use:
./run-airflow-external-matlab.shThis script enables the runtime-matlab service, which pulls the MATLAB Runtime container image and makes it accessible to Airflow.
Once running, the Airflow decoder DAG is usually available at:
Trigger it to run the decoder on a demonstration Dataset (one cycle of float 6904182)
From the point of view of your Airflow DAGs, there is no difference between the two modes:
the runtime is always mounted at /opt/matlab/runtime.
This means the same DAG code works whether you rely on MATLAB installed locally or on the containerized runtime.
👉 Summary:
- Use
./run-airflow-local-matlab.shif MATLAB Runtime is installed on your host. - Use
run-airflow-matlab.shif you don't have MATLAB Runtime this will run in background in a container. - In both cases, your DAGs remain unchanged.
Depending on your environment, replace docker compose with docker-compose if needed.
# Check services
docker compose ps
# Follow logs
docker compose logs -f
# Restart after modifications
docker compose up -d --build
# Stop services (keep volumes)
docker compose down
# Stop AND remove volumes (⚠️ deletes Airflow metadata)
docker compose down -v-
Permission denied on logs or Airflow home
EnsureAIRFLOW_UID/AIRFLOW_GIDmatch your current user. Re-run./run-airflow.sh. -
docker: command not foundor Compose not found
Install Docker and the Compose plugin (or thedocker-composebinary), then try again. -
Port 8080 already in use
Change the port mapping incompose.override.yml.
Happy flying