-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compose): Create a proper example compose
- Loading branch information
Showing
3 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,58 @@ | ||
name: airflow | ||
|
||
x-airflow-variables: &airflow-variables | ||
AIRFLOW__CORE__EXECUTOR: "SequentialExecutor" # Use LocalExecutor when running with postgres | ||
AIRFLOW__CORE__LOAD_EXAMPLES: "False" | ||
AIRFLOW__CORE__DAG_IGNORE_FILE_SYNTAX: "glob" | ||
AIRFLOW__CORE__DAGS_FOLDER: "/opt/airflow/dags" | ||
AIRFLOW__LOGGING__BASE_LOG_FOLDER: "/opt/airflow/logs" | ||
AIRFLOW__LOGGING__LOGGING_LEVEL: WARNING | ||
AIRFLOW_CONN_SLACK_API_DEFAULT: not-a-slack-conn | ||
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: "True" | ||
|
||
|
||
x-common-variables: &common-variables | ||
SECRET_KEY: ${SECRET_KEY} | ||
ECS_SUBNET: $ECS_SUBNET | ||
ECS_SECURITY_GROUP: $ECS_SECURITY_GROUP | ||
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION | ||
ENVIRONMENT: $ENVIRONMENT | ||
|
||
services: | ||
|
||
airflow: | ||
container_name: airflow-dags | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
post_start: | ||
- command: | | ||
/usr/bin/dumb-init -- /entrypoint db init && \ | ||
/usr/bin/dumb-init -- /entrypoint users create \ | ||
--role Admin --username admin --password admin \ | ||
--firstname admin --lastname admin --email [email protected] | ||
command: ["webserver", "-w", "4"] | ||
scheduler: | ||
image: apache/airflow:2.10.5 | ||
container_name: airflow-scheduler | ||
command: scheduler | ||
restart: always | ||
ports: | ||
- "8793:8793" | ||
environment: | ||
_AIRFLOW_WWW_USER_CREATE: "true" | ||
_AIRFLOW_WWW_USER_USERNAME: airflow | ||
_AIRFLOW_WWW_USER_PASSWORD: airflow | ||
<<: [*airflow-variables, *common-variables] | ||
user: "${AIRFLOW_UID:-50000}:0" | ||
volumes: | ||
- data:/opt/airflow | ||
|
||
webserver: | ||
image: apache/airflow:2.10.5 | ||
container_name: airflow-webserver | ||
command: webserver -w 4 | ||
ports: | ||
- "4040:8080" | ||
- 4040:8080 | ||
restart: always | ||
post_start: | ||
- command: | | ||
/usr/bin/dumb-init -- /entrypoint db migrate | ||
environment: | ||
<<: [*airflow-variables, *common-variables] | ||
# AIRFLOW__WEBSERVER__SECRET_KEY: ${SECRET_KEY} | ||
# FORWARDED_ALLOW_IPS: "*" | ||
AIRFLOW__WEBSERVER__WORKER_CLASS: "gevent" | ||
_AIRFLOW_PATCH_GEVENT: "1" | ||
user: "${AIRFLOW_UID:-50000}:0" | ||
volumes: | ||
- data:/opt/airflow | ||
|
||
volumes: | ||
data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters