0
I want to synchronize a file that is inside my container with my host. I thought of simply creating a volume for the file, getting that way:
version: '3.7'
services:
deathrun:
image: "ceifa/lory-gmod-deathrun"
volumes:
- ./stateful/deathrun/sv.db:/server/garrysmod/sv.db
restart: always
tty: true
However, as the file does not exist on the host the first time it runs, it is being automatically created a folder in place of the file and giving the following error:
ERROR: for deathrun Cannot start service deathrun: "..." caused "not a directory": Unknown: Are you trying to mount a directory onto a file (or vice versa)? Check if the specified host path exists and is the expected type
How to make it grab the container file instead of trying to create it on the host?
Can you verify the answer? Don’t forget to accept it if you are satisfied with it.
– tvdias