version: '2.1'
services:
    postgres:
        image: postgres:9.6
        environment:
            - POSTGRES_USER=airflow
            - POSTGRES_PASSWORD=airflow
            - POSTGRES_DB=airflow

    webserver:
        image: aiscalator/airflow:latest
        restart: always
        depends_on:
            - postgres
        environment:
            - LOAD_EX=n
            - EXECUTOR=Local
        volumes:
            - ../dags:/usr/local/airflow/dags
            - ./airflow.cfg:/usr/local/airflow/airflow.cfg
            - /var/run/docker.sock:/var/run/docker.sock
            # Custom workspace to mount
            #workspace#
            # Uncomment to include custom plugins
            # - ../plugins:/usr/local/airflow/plugins
        ports:
            - "8080:8080"
        command: webserver
        healthcheck:
            test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"]
            interval: 30s
            timeout: 30s
            retries: 3
