MCPcopy
hub / github.com/prisma/prisma / isInContainer

Function isInContainer

packages/internals/src/utils/isInContainer.ts:7–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 * Checks for common signs of Docker, Podman, and Kubernetes.
6 */
7export function isInContainer(): boolean {
8 try {
9 return (
10 fs.existsSync('/.dockerenv') ||
11 fs.existsSync('/run/.containerenv') ||
12 process.pid === 1 ||
13 process.env.KUBERNETES_SERVICE_HOST !== undefined
14 )
15 } catch {
16 return false
17 }
18}

Callers 1

handleNpsSurveyImplFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected