I am running Airflow in docker container. I have created a separate container to run Postgres server and Rabbitmq server, connected these containers using docker network - by following this nice article. Now my Airflow docker container is running and connected to other containers using docker network - the process went smooth so far. The problem is how to run airflow webserver, airflow scheduler and airflow worker in the same container. After some research I found: it is recommended to run one service in one container. Now I have two solutions
- Run multiple services in the same Airflow container - which I could not figure out a simple way implement being a new bee in Docker.
- Create separate containers to run Celery worker and Airflow scheduler - but in the airflow.cfg file the setting related to Celery are:
broker_url = 'amqp://guest:guest@ksaprice_rabbitmq:8080//',celery_result_backend = db+postgresql://developer:user889@ksaprice_postgres:5432/airflow. These settings refer to either database or rabbitmq which are already running different containers - they do not refer to ip/url which runs celery and scheduler and I assuming it is this way because celery and scheduler runs on the airflow server.
My questions are:
- Reffering to point 1: Is there a simple way to run
airflow webserver,airflow schedulerandairflow workercommands in the same Airflow container? - Refferring to point 2: Is there a way in airflow.cfg to configure airflow scheduler and airflow worker to run in separate docker containers - and link them using docker network?
I am new bee to Airflow and Docker.