### 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)

configs=[types.ConfigReference(config_id="dummy_cfg_id", config_name="dummy_cfg_name")],
            secrets=[types.SecretReference(secret_id="dummy_secret_id", secret_name="dummy_secret_name")],
            mode=types.ServiceMode(mode="replicated", replicas=3),
            networks=["dummy_network"],
            placement=types.Placement(constraints=["node.labels.region==east"]),
        )
        operator.execute(None)
        types_mock.TaskTemplate.assert_called_once_with(
            container_spec=mock_obj,
            restart_policy=mock_obj,
            resources=mock_obj,
            networks=["dummy_network"],
            placement=types.Placement(constraints=["node.labels.region==east"]),
        )
        types_mock.ContainerSpec.assert_called_once_with(
            image="ubuntu:latest",
            command="env",
            user="unittest",
            mounts=[types.Mount(source="/host/path", target="/container/path", type="bind")],
            tty=True,
            env={"UNIT": "TEST", "AIRFLOW_TMP_DIR": "/tmp/airflow"},
            configs=[types.ConfigReference(config_id="dummy_cfg_id", config_name="dummy_cfg_name")],
            secrets=[types.SecretReference(secret_id="dummy_secret_id", secret_name="dummy_secret_name")],
        )
        types_mock.RestartPolicy.assert_called_once_with(condition="none")
        types_mock.Resources.assert_called_once_with(mem_limit="128m")
        docker_api_client_patcher.assert_called_once_with(
            base_url="unix://var/run/docker.sock", tls=False, version="1.19", timeout=DEFAULT_TIMEOUT_SECONDS
        )
        client_mock.service_logs.assert_called_once_with(