frigate icon indicating copy to clipboard operation
frigate copied to clipboard

Specify BASE_DIR via environment in docker

Open Parlane opened this issue 2 years ago • 5 comments

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.

Parlane avatar Jul 10 '22 23:07 Parlane

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

NickM-27 avatar Jul 11 '22 00:07 NickM-27

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.

Parlane avatar Jul 11 '22 01:07 Parlane

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.

stale[bot] avatar Aug 10 '22 02:08 stale[bot]

I would still like this ability... thanks :)

Parlane avatar Aug 10 '22 02:08 Parlane

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.

blakeblackshear avatar Aug 10 '22 12:08 blakeblackshear