# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Basic Airflow cluster configuration for development purposes with LDAP Auth. # # WARNING: This configuration is for local development. Do not use it in a production deployment. # # This configuration supports basic configuration using environment variables or an .env file # The following variables are supported: # # Feel free to modify this file to suit your needs. version: '3.8' x-airflow-common: &airflow-common # In order to add custom dependencies or upgrade provider packages you can use your extended image. # Comment the image line and uncomment the "build" and "context" lines below, Then run `docker-compose build` to build the images. image: baobabsoluciones/airflow:release-v1.1.0 platform: linux/amd64 #build: #context: ./cornflow-server/airflow_config environment: &airflow-common-env AIRFLOW_DB_HOST: airflow_db AIRFLOW_DB_PORT: 5432 AIRFLOW_DB_USER: airflow AIRFLOW_DB_PASSWORD: airflow AIRFLOW_DB: airflow AIRFLOW__WEBSERVER__INSTANCE_NAME: CornflowEnv AIRFLOW__WEBSERVER__NAVBAR_COLOR: '#0693e3' AIRFLOW_LDAP_ENABLE: 'True' AIRFLOW_LDAP_URI: ldap://openldap:389 AIRFLOW_LDAP_SEARCH: ou=users,dc=example,dc=org AIRFLOW_LDAP_BIND_USER: cn=admin,dc=example,dc=org AIRFLOW_LDAP_BIND_PASSWORD: admin AIRFLOW_LDAP_UID_FIELD: cn # cornflow user and password from LDAP credentials file in cornflow-server/airflow_config/ldapbootstrap.ldif CORNFLOW_SERVICE_USER: cornflow CORNFLOW_SERVICE_PWD: cornflow1234 volumes: - ./cornflow-dags/DAG:/usr/local/airflow/dags - ./cornflow-dags/requirements.txt:/requirements.txt - ./cornflow-server/airflow_config/logs:/usr/local/airflow/logs - ./cornflow-server/airflow_config/plugins:/usr/local/airflow/plugins - ./cornflow-server/airflow_config/airflow_local_settings.py:/usr/local/airflow/config/airflow_local_settings.py depends_on: &airflow-common-depends-on airflow_db: condition: service_healthy x-cornflow-common: &cornflow-common # In order to add custom dependencies or upgrade provider packages you can use your extended image. # Comment the image line and uncomment the "build" and "context" lines below, Then run `docker-compose build` to build the images. image: baobabsoluciones/cornflow:release-v1.1.0 platform: linux/amd64 #build: #context: ./cornflow-server environment: &cornflow-common-env CORNFLOW_DB_HOST: cornflow_db CORNFLOW_DB_PORT: 5432 CORNFLOW_DB_USER: cornflow CORNFLOW_DB_PASSWORD: cornflow CORNFLOW_DB: cornflow AUTH_TYPE: 2 LDAP_HOST: ldap://openldap:389 LDAP_BIND_DN: cn=admin,dc=example,dc=org LDAP_BIND_PASSWORD: admin LDAP_SERVICE_BASE: ou=service,dc=example,dc=org CORNFLOW_SERVICE_USER: cornflow # airflow user and password from LDAP credentials file in cornflow-server/airflow_config/ldapbootstrap.ldif AIRFLOW_USER: administrator AIRFLOW_PWD: administrator1234 depends_on: &cornflow-common-depends-on cornflow_db: condition: service_healthy webserver: condition: service_healthy services: cornflow: <<: *cornflow-common restart: always ports: - 5000:5000 healthcheck: test: ["CMD-SHELL", "[ -f /usr/src/app/gunicorn.pid ]"] interval: 30s timeout: 30s retries: 5 environment: <<: *cornflow-common-env depends_on: <<: *cornflow-common-depends-on cornflow_db: image: postgres:15.4 environment: - POSTGRES_USER=cornflow - POSTGRES_PASSWORD=cornflow - POSTGRES_DB=cornflow healthcheck: test: ["CMD", "pg_isready", "-U", "cornflow"] interval: 10s retries: 5 start_period: 5s restart: always volumes: - postgres_cf_data:/var/lib/postgresql/data/ airflow_db: image: postgres:15.4 environment: - POSTGRES_USER=airflow - POSTGRES_PASSWORD=airflow - POSTGRES_DB=airflow healthcheck: test: ["CMD", "pg_isready", "-U", "airflow"] interval: 10s retries: 5 start_period: 5s volumes: - postgres_af_data:/var/lib/postgresql/data/ webserver: <<: *airflow-common command: webserver ports: - 8080:8080 healthcheck: test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"] interval: 30s timeout: 30s retries: 5 environment: <<: *airflow-common-env restart: always depends_on: <<: *airflow-common-depends-on openldap: image: osixia/openldap command: --copy-service container_name: openldap hostname: openldap ports: - 389:389 - 636:636 volumes: - ./cornflow-server/airflow_config/ldapbootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif:ro environment: - LDAP_REMOVE_CONFIG_AFTER_SETUP=false phpldapadmin: image: osixia/phpldapadmin:0.9.0 container_name: phpldapadmin hostname: phpldapadmin ports: - 8081:80 environment: - PHPLDAPADMIN_LDAP_HOSTS=openldap - PHPLDAPADMIN_HTTPS=false depends_on: - openldap volumes: postgres_cf_data: postgres_af_data: