def start()

in composer_local_dev/environment.py [0:0]


    def start(self, assert_not_running=True):
        """Starts local composer environment.

        Before starting we are asserting that are required files in the
        environment directory. The docker container is created and started.
        This operation will raise an error if we are trying to use port that
        is already allocated.
        Started environment is polled until Airflow scheduler starts.
        """
        assert_image_exists(self.image_version)
        self.assert_requirements_exist()
        files.assert_dag_path_exists(self.dags_path)

        self.create_database_files()
        db_path = self.airflow_db if self.is_database_sqlite3 else self.airflow_db_folder
        files.fix_file_permissions(
            entrypoint=self.entrypoint_file,
            run=self.run_file,
            requirements=self.requirements_file,
            db_path=db_path,
        )
        files.fix_line_endings(
            entrypoint=self.entrypoint_file,
            run=self.run_file,
            requirements=self.requirements_file,
        )

        if not self.is_database_sqlite3:
            LOG.info(f"Database engine is selected as {self.database_engine}. The container will start before")
            db_container = self.start_container(self.db_container_name, False)
            self.wait_for_db_start()
            self.ensure_container_is_attached_to_network(db_container)
            LOG.info(f"Database started!")

        container = self.start_container(self.container_name, assert_not_running)
        self.ensure_container_is_attached_to_network(container)
        self.wait_for_start()
        self.print_start_message()