### Apache Airflow Provider(s)

docker

### Versions of Apache Airflow Providers

apache-airflow-providers-celery==3.1.0
apache-airflow-providers-docker==3.3.0

### Apache Airflow version

2.5.0

### Operating System

centos 7

### Deployment

Other Docker-based deployment

### Deployment details

Running an a docker-swarm cluster deployed locally. 

### What happened

Same issue as https://github.com/apache/airflow/issues/13675

With logging_enabled=True the DAG never completes and stays in running. 

When using DockerSwarmOperator together with the default enable_logging=True option, tasks do not succeed and stay in state running. When checking the docker service logs I can clearly see that the container ran and ended successfully. Airflow however does not recognize that the container finished and keeps the tasks in state running.

### What you think should happen instead

DAG should complete.

### How to reproduce

Docker-compose deployment:
```console
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.5.0/docker-compose.yaml'
docker compose up airflow-init
docker compose up -d
```

DAG code:

```python
from airflow import DAG
from docker.types import Mount, SecretReference
from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator
from datetime import timedelta
from airflow.utils.dates import days_ago
from airflow.models import Variable


# Setup default args for the job
default_args = {
	'owner': 'airflow',
	'start_date': days_ago(2),
	'retries': 0
}
 
# Create the DAG
dag = DAG(
    'test_dag',         # DAG ID
    default_args=default_args,
    schedule_interval='0 0 * * *', 
    catchup=False
)

# # Create the DAG object
with dag as dag:
	  docker_swarm_task = DockerSwarmOperator(
			task_id="job_run",
			image="<any image>",
			execution_timeout=timedelta(minutes=5),
			command="<specific code>",
			api_version='auto',
			tty=True,
			enable_logging=True
		)
```

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

:param tls_client_cert: Path to the PEM-encoded certificate
        used to authenticate docker client.
    :param tls_client_key: Path to the PEM-encoded key used to authenticate docker client.
    :param tls_hostname: Hostname to match against
        the docker server certificate or False to disable the check.
    :param tls_ssl_version: Version of SSL to use when communicating with docker daemon.
    :param tmp_dir: Mount point inside the container to
        a temporary directory created on the host by the operator.
        The path is also made available via the environment variable
        ``AIRFLOW_TMP_DIR`` inside the container.
    :param user: Default user inside the docker container.
    :param docker_conn_id: The :ref:`Docker connection id <howto/connection:docker>`
    :param tty: Allocate pseudo-TTY to the container of this service
        This needs to be set see logs of the Docker container / service.
    :param enable_logging: Show the application's logs in operator's logs.
        Supported only if the Docker engine is using json-file or journald logging drivers.
        The `tty` parameter should be set to use this with Python applications.
    :param configs: List of docker configs to be exposed to the containers of the swarm service.
        The configs are ConfigReference objects as per the docker api
        [https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
    :param secrets: List of docker secrets to be exposed to the containers of the swarm service.
        The secrets are SecretReference objects as per the docker create_service api.
        [https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
    :param mode: Indicate whether a service should be deployed as a replicated or global service,
        and associated parameters
    :param networks: List of network names or IDs or NetworkAttachmentConfig to attach the service to.
    :param placement: Placement instructions for the scheduler. If a list is passed instead,
        it is assumed to be a list of constraints as part of a Placement object.
    """
    def __init__(