Hello,
Even if the path does not exist you can create it when specifying your volume in the docker-compose file.
Example:
version: "2.4"
services:
web:
image: nginx:alpine
ports:
- "80:80"
volumes:
- type: bind
source: ./pathToCert
target: /var/run/secrets/kubernetes.io/serviceaccount
networks:
webnet:
volumes:
mydata: