mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
fix(insights): check if running in a container
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
6bc4c0317f
commit
906ac635c2
4 changed files with 17 additions and 5 deletions
|
@ -3,6 +3,7 @@ package consts
|
|||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -134,3 +135,11 @@ var (
|
|||
|
||||
ServerStart = time.Now()
|
||||
)
|
||||
|
||||
var InContainer = func() bool {
|
||||
// Check if the /.nddockerenv file exists
|
||||
if _, err := os.Stat("/.nddockerenv"); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue