question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specify BASE_DIR via environment in docker

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
blakeblackshearcommented, Aug 10, 2022

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.

0reactions
Parlanecommented, Aug 10, 2022

I would still like this ability… thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables in Compose | Docker Documentation
You can set default values for environment variables using a .env file, which Compose automatically looks for in project directory (parent folder of...
Read more >
Docker: adding a file from a parent directory - Stack Overflow
Let's say you want to copy dir2 content into a new docker image using COPY or ADD of dockerfile that is in dir11...
Read more >
docker-volume-basedir in sam local start-lambda is not used ...
It seems to have no effect at all. Logs still shows paths of devcontainer not the path of host machine I specified via...
Read more >
Docker and JAVA_OPTS - Veracode
While adjusting some environment variables recently, I came across an odd issue with Docker, Spring Boot and JAVA_OPTS.
Read more >
How to Set Docker Environment Variables {ARG and ENV}
1. Create a directory for the new Docker image and cd into the path. mkdir [directory-path] && cd [directory-path] · 2. Create a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found