frigate
frigate copied to clipboard
Specify BASE_DIR via environment in docker
Describe what you are trying to accomplish and why in non technical terms Hey @blakeblackshear, it would be great if I could specify BASE_DIR from docker environment instead of the hardcoded /media/frigate.
Personally, I just want to use /data/frigate so when I run lsof commands on my host they point to the correct place and lsof wont then show:
frigate.o 26730 root mem REG 0,38 32897 /media/frigate/frigate.db-shm (stat: No such file or directory)
Describe the solution you'd like An environment variable to override the default BASE_DIR:
import os
BASE_DIR = os.environ.get("FRIGATE_BASE_DIR", "/media/frigate")
CLIPS_DIR = f"{BASE_DIR}/clips"
RECORD_DIR = f"{BASE_DIR}/recordings"
CACHE_DIR = "/tmp/cache"
YAML_EXT = (".yaml", ".yml")
Describe alternatives you've considered
Possibly you could define the directories in the config file too.
Are you running HAOS or linux?
with linux standard docker you should be able to map /data/frigate
/media/frigate
and it'll work today, the file structure inside the container shouldn't matter
Are you running HAOS or linux?
with linux standard docker you should be able to map
/data/frigate
/media/frigate
and it'll work today, the file structure inside the container shouldn't matter
Thanks @NickM-27, I run frigate as a docker container under debian.
I did add the bit about why I wanted it under the second paragraph of my feature request. My mapping works fine, it's just a request for a tidier mount point.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I would still like this ability... thanks :)
This has other implications since nginx uses the media directory as well. It would require making that config dynamic and today it is statically defined. I am fine leaving this open in case one day it makes sense.