Skip to content

Instantly share code, notes, and snippets.

@loverico
Last active November 24, 2020 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loverico/eec0ee80ef0c7116cfce202bdb875d01 to your computer and use it in GitHub Desktop.
Save loverico/eec0ee80ef0c7116cfce202bdb875d01 to your computer and use it in GitHub Desktop.
version: '3.7'
services:
postgres:
container_name:
"airflow_postgres"
image: postgres:9.6
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
logging:
options:
max-size: 10m
max-file: "3"
volumes:
- airflow_database:/var/lib/postgresql/data
webserver:
container_name: 'airflow_server'
image: puckel/docker-airflow:for_gcp
restart: always
depends_on:
- postgres
env_file:
- .env
logging:
options:
max-size: 10m
max-file: "3"
volumes:
- ./composer/dags:/usr/local/airflow/dags #composer と DAG フォルダパスを合致させるなら、 /home/airflow/gcs/dags に設定
- ./local_airflow/config:/tmp/config
- ./local_airflow/credentials/:/tmp/credentials/
ports:
- "${WEB_SERVER_PORT}:8080"
command: >
bash -c "
gcloud auth activate-service-account ${SERVICE_ACCOUNT} --key-file=${GOOGLE_APPLICATION_CREDENTIALS} --project ${PROJECT_ID} &&
airflow variables --import /tmp/config/${AIRFLOW_VARIABLE_FILE_NAME} &&
/entrypoint.sh webserver
"
volumes:
airflow_database:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment