Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Disable Sentry inside Docker (#1781)

Kostas Bariotis8f65e37dac78
diff --git a/Dockerfile b/Dockerfile
index dc88aff19d..298b440700 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,12 +17,10 @@ COPY . .
FROM node:14-alpine AS build
ARG NODE_ENV=production
-ARG REACT_APP_INCLUDE_GTAG=false
WORKDIR /opt/node_app
COPY --from=deps /opt/node_app .
-RUN ls
-RUN npm run build:app
+RUN npm run build:app:docker
FROM nginx:1.17-alpine
diff --git a/package.json b/package.json
index 4d3c106787..47322e3c2d 100644
--- a/package.json
+++ b/package.json
@@ -75,6 +75,7 @@
"build": "npm run build:app && npm run build:zip",
"build-node": "node ./scripts/build-node.js",
"build:app": "REACT_APP_INCLUDE_GTAG=true REACT_APP_GIT_SHA=$NOW_GITHUB_COMMIT_SHA react-scripts build",
+ "build:app:docker": "REACT_APP_INCLUDE_GTAG=false REACT_APP_DISABLE_SENTRY=true react-scripts build",
"build:zip": "node ./scripts/build-version.js",
"eject": "react-scripts eject",
"fix": "npm run fix:other && npm run fix:code",
diff --git a/src/index.tsx b/src/index.tsx
index e888ea3d40..38a7b6fb3b 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -27,12 +27,14 @@ const SentryEnvHostnameMap: { [key: string]: string } = {
"now.sh": "staging",
};
-const onlineEnv = Object.keys(SentryEnvHostnameMap).find(
- (item) => window.location.hostname.indexOf(item) >= 0,
-);
+// Disable Sentry locally or inside the Docker to avoid noise/respect privacy
+const onlineEnv =
+ process.env.REACT_APP_DISABLE_SENTRY !== "true" &&
+ Object.keys(SentryEnvHostnameMap).find(
+ (item) => window.location.hostname.indexOf(item) >= 0,
+ );
Sentry.init({
- // Disable Sentry locally to avoid noise
dsn: onlineEnv
? "https://[email protected]/5179260"
: undefined,