Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (81 sloc) 2.53 KB
package include
import "strings"
// Composeyml is the docker-compose template
var Composeyml = strings.TrimSpace(`
version: '2'
networks:
airflow:
driver: bridge
volumes:
postgres_data:
driver: local
airflow_logs:
driver: local
services:
postgres:
image: postgres:10.1-alpine
restart: unless-stopped
networks:
- airflow
labels:
io.astronomer.docker: "true"
io.astronomer.docker.cli: "true"
ports:
- {{ .PostgresPort }}:5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: {{ .PostgresUser }}
POSTGRES_PASSWORD: {{ .PostgresPassword }}
scheduler:
image: {{ .AirflowImage }}
command: ["airflow", "scheduler"]
restart: unless-stopped
networks:
- airflow
user: {{ .AirflowUser }}
labels:
io.astronomer.docker: "true"
io.astronomer.docker.cli: "true"
io.astronomer.docker.component: "airflow-scheduler"
depends_on:
- postgres
environment:
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql://{{ .PostgresUser }}:{{ .PostgresPassword }}@{{ .PostgresHost }}:5432
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw="
volumes:
- {{ .AirflowHome }}/dags:/usr/local/airflow/dags:ro
- {{ .AirflowHome }}/plugins:/usr/local/airflow/plugins:ro
- {{ .AirflowHome }}/include:/usr/local/airflow/include:ro
- airflow_logs:/usr/local/airflow/logs
{{ .AirflowEnvFile }}
webserver:
image: {{ .AirflowImage }}
command: ["airflow", "webserver"]
restart: unless-stopped
networks:
- airflow
user: {{ .AirflowUser }}
labels:
io.astronomer.docker: "true"
io.astronomer.docker.cli: "true"
io.astronomer.docker.component: "airflow-webserver"
depends_on:
- scheduler
- postgres
environment:
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql://{{ .PostgresUser }}:{{ .PostgresPassword }}@{{ .PostgresHost }}:5432
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw="
ports:
- {{ .AirflowWebserverPort }}:8080
volumes:
- {{ .AirflowHome }}/dags:/usr/local/airflow/dags:ro
- {{ .AirflowHome }}/plugins:/usr/local/airflow/plugins:ro
- {{ .AirflowHome }}/include:/usr/local/airflow/include:ro
- airflow_logs:/usr/local/airflow/logs
{{ .AirflowEnvFile }}
`)