Skip to content

Commit ca78643

Browse files
athul-rsclaude
andauthored
UN-2236 [FEAT] Add build-time PostHog control for on-prem deployments (#1615)
Added build argument to control PostHog analytics at build time, enabling cloud deployments while disabling for on-prem installations. Changes: - Added REACT_APP_ENABLE_POSTHOG build argument to frontend Dockerfile - Defaults to true to maintain cloud behavior - Updated sample.env with PostHog configuration documentation - Default set to false for local development (privacy-first) This provides clean separation between cloud (analytics enabled) and on-prem (analytics disabled) builds without runtime complexity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 14cbd6b commit ca78643

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

docker/dockerfiles/frontend.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ CMD ["npm", "start"]
2323
### FOR PRODUCTION ###
2424
# Builder stage for production build
2525
FROM base AS builder
26+
ARG REACT_APP_ENABLE_POSTHOG=true
2627
ENV REACT_APP_BACKEND_URL=""
28+
ENV REACT_APP_ENABLE_POSTHOG=${REACT_APP_ENABLE_POSTHOG}
2729

2830
# Copy package files and install dependencies
2931
COPY ${BUILD_CONTEXT_PATH}/package.json ${BUILD_CONTEXT_PATH}/package-lock.json ./

frontend/sample.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
REACT_APP_BACKEND_URL=http://localhost:8000
22

3+
# Analytics - PostHog (set to false to disable tracking)
4+
# Default: false for local development
5+
REACT_APP_ENABLE_POSTHOG=false
6+
37
# For development
48
NODE_ENV=development
59
# Enable file watching via polling instead of filesystem events

0 commit comments

Comments
 (0)