You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/12 20:32:33 UTC
[GitHub] [airflow] feluelle edited a comment on issue #8605: Add Production-ready docker compose for the production image
feluelle edited a comment on issue #8605:
URL: https://github.com/apache/airflow/issues/8605#issuecomment-643470106
My `docker-compose.yaml` file for running _LocalExecutor_ with meta-db _postgres_ using apache airflow prod official Docker file.
```yaml
version: '3.7'
x-airflow-common:
&airflow-common
environment:
- AIRFLOW_HOME=/opt/airflow/1-orchestration
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
- AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@airflow_db:5432/airflow
- AIRFLOW__CORE__FERNET_KEY=FB0o_zt4e3Ziq3LdUUO7F2Z95cvFFx16hU8jTeR1ASM=
- AIRFLOW__CORE__LOAD_EXAMPLES=False
- AIRFLOW__WEBSERVER__RBAC=True
image: apache/airflow:master-python3.7
build:
context: https://github.com/apache/airflow.git
args:
AIRFLOW_EXTRAS: amazon,postgres,google
ADDITIONAL_PYTHON_DEPS: dbt great_expectations
services:
airflow_db:
image: library/postgres:10
container_name: airflow_db
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
ports:
- 35432:5432
restart: always
airflow_db_init:
<<: *airflow-common
container_name: airflow_db_init
command: db upgrade
depends_on:
- airflow_db
airflow_users_init:
<<: *airflow-common
container_name: airflow_users_init
command: users create --role Admin --username admin --email admin@airflow.community --firstname Admin --lastname Airflow --password airflow
depends_on:
- airflow_db_init
airflow_variables_init:
<<: *airflow-common
container_name: airflow_variables_init
entrypoint: /opt/airflow/0-environment/scripts/init_airflow_variables.sh
volumes:
- ./scripts:/opt/airflow/0-environment/scripts
depends_on:
- airflow_db_init
airflow_connections_init:
<<: *airflow-common
container_name: airflow_connections_init
entrypoint: /opt/airflow/0-environment/scripts/init_airflow_connections.sh
volumes:
- ./scripts:/opt/airflow/0-environment/scripts
depends_on:
- airflow_db_init
airflow_webserver:
<<: *airflow-common
container_name: airflow_webserver
command: webserver
ports:
- 38080:8080
volumes:
- ../1-orchestration:/opt/airflow/1-orchestration
- ../2-expectations:/opt/airflow/2-expectations
- ../3-transformations:/opt/airflow/3-transformations
depends_on:
- airflow_db
restart: always
airflow_scheduler:
<<: *airflow-common
container_name: airflow_scheduler
command: scheduler
volumes:
- ../1-orchestration:/opt/airflow/1-orchestration
- ../2-expectations:/opt/airflow/2-expectations
- ../3-transformations:/opt/airflow/3-transformations
depends_on:
- airflow_db
restart: always
```
In case you are wondering. I am setting up Airflow (`1-orchestration`) for _ELT_ with great_expectations (`2-expectations`) and dbt (`3-transformations`).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org