I am testing some stuff where I have to init my Postgres DB DDL into airflow Postgres DB when I compose-up it should automatically init for one time as it will be cached afterward as airflow DB works usually. Thanks
I am testing some stuff where I have to init my Postgres DB DDL into airflow Postgres DB when I compose-up it should automatically init for one time as it will be cached afterward as airflow DB works usually. Thanks
2
Answers
I have found a solution that works and init your scripts when you docker composed up.
pro TIP: If you want to add more files and you have already init the airflow DB or your DB what you can do is docker-compose down --volume what this will do will automatically remove all the data in the data directory. and for init to work Postgres data directory have to be empty
As requested in the last comment: Adding your own database to the Airflow Docker-compose file:
Put this piece of code as a service somewhere amongst the other services:
Make sure you have a database-directory and a init-database.sh file in the current directory (otherwise the volume mappings fail)