scheduler: This service is responsible for scheduling tasks, defining dependencies, and determining execution times.
trigger: This service manages external event triggers for task execution.
Both services inherit common settings (airflow-common, environment variables, dependencies, and volumes) and specify their respective commands (scheduler and triggerer).
Next we can configures the Airflow webserver service, setting up a default admin user with provided environment variables and specifying dependencies, volumes, and port mappings for accessing the web interface. A webserver serves the web-based user interface for managing and monitoring Airflow workflows.
Recommendation would be to setup .envrc file with all the environment variables
Standard parameters are set for the Postgres service in the compose.yml file.
Health Check: The health check ensures that the Postgres container is running and accepting connections. It executes the command pg_isready -U airflow -d airflow every 10 seconds and retries up to 5 times before marking the container as unhealthy. This helps in automatically managing the container's health status and ensures reliability in your setup.
Before configuring the services, the volume for Postgres should be set up, and the secrets for the databases should be imported.
secrets:
connections.json:
file: .secrets/connections.json
volumes:
postgres_data: