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?