version: "3" services: postgres: image: "postgres:9.6" container_name: "postgres" environment: - POSTGRES_USER=airflow - POSTGRES_PASSWORD=airflow - POSTGRES_DB=airflow ports: - "5432:5432" volumes: - ./data/postgres:/var/lib/postgresql/data # uncomment initdb if you need initdb at first run # initdb: # build: . # entrypoint: airflow initdb # depends_on: # - postgres webserver: build: . restart: always depends_on: - postgres volumes: - ./airflow_files/dags:/usr/local/airflow/dags ports: - "8080:8080" entrypoint: airflow webserver healthcheck: test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"] interval: 30s timeout: 30s retries: 3 scheduler: build: . restart: always depends_on: - postgres - webserver volumes: - ./airflow_files/dags:/usr/local/airflow/dags - ./airflow_files/logs:/usr/local/airflow/logs entrypoint: airflow scheduler healthcheck: test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-scheduler.pid ]"] interval: 30s timeout: 30s retries: 3