Skip to content

Commit

Permalink
Adds an extra failsafe to is_docker function (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k authored Jul 13, 2023
1 parent 1d3cd66 commit a5da311
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM python:3.8-alpine

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV CONTAINERIZED True

RUN apk add --update curl tini && \
rm -rf /var/cache/apk/*
Expand Down
3 changes: 2 additions & 1 deletion plex_auto_languages/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def is_docker():
path = "/proc/self/cgroup"
return (
os.path.exists("/.dockerenv") or
os.path.isfile(path) and any("docker" in line for line in open(path, "r", encoding="utf-8"))
os.path.isfile(path) and any("docker" in line for line in open(path, "r", encoding="utf-8")) or
os.getenv('CONTAINERIZED', False).lower() == 'true'
)


Expand Down

0 comments on commit a5da311

Please sign in to comment.