Giving spawned containers access to bind mount from spawning container

I have an application that spawns services on a swarm on the host machine. For development of the application, I have a docker compose that looks something like:

services:
  fastapi:
    image: director_base
    volumes:
      - ./docker/storage/:/data
      - /var/run/docker.sock:/var/run/docker.sock

As you can see, any swarm services spawned are spawned on the host, not inside the docker compose service. However, I want to mount a specific subdirectory of /data inside each service. Doing this fails, presumably because, while /data exists inside the fastapi service, it does not exist on my local machine.

Is there any way to add /data as a mount on the service without modifying the application? Or do I have to go to the Docker-in-Docker route?

When you use a remote docker daemmon from your client, can you mount a local folder to a container on a remote server? You can’t. This is practically the same situation. You manage the daemon on the host. It will not mount a folder from the container just because the client is in that container. Even if both containers are on the same host, the the daemon is still outside the containers. You can use a common volume for both. I think we had another similar topic somehwhere where @bluepuma77 suggested this perfectly good idea.

If you really want to mount a folder from the container without using a common volume, yes.