Skip to content

fix(create-plugin): respect development flag for GF_DEFAULT_APP_MODE#2598

Open
nickmopen wants to merge 1 commit intografana:mainfrom
nickmopen:fix/create-plugin-gf-default-app-mode
Open

fix(create-plugin): respect development flag for GF_DEFAULT_APP_MODE#2598
nickmopen wants to merge 1 commit intografana:mainfrom
nickmopen:fix/create-plugin-gf-default-app-mode

Conversation

@nickmopen
Copy link
Copy Markdown

What this PR does / why we need it:

Previously, the .config/Dockerfile template hardcoded ENV GF_DEFAULT_APP_MODE "development" unconditionally, meaning Grafana always started in development mode regardless of the development build arg passed to docker compose. This caused buildInfo.env to always report "development" in the browser, making it impossible to test plugins running against a production Grafana instance.

This PR fixes the issue by:

  • Removing the hardcoded ENV GF_DEFAULT_APP_MODE "development" from the Dockerfile
  • Setting GF_DEFAULT_APP_MODE dynamically in entrypoint.sh — defaults to development (preserving existing behaviour), and switches to production only when DEV=false

Which issue(s) this PR fixes:

Fixes #2171

Special notes for your reviewer:

  • The default behaviour (development mode) is unchanged — GF_DEFAULT_APP_MODE is only explicitly set to "production" when DEVELOPMENT=false is passed to docker compose. All other cases fall through to Grafana's own default which is development.
  • Tested locally by scaffolding a panel plugin and running both DEVELOPMENT=false docker compose up (verified GF_DEFAULT_APP_MODE=production in PID 1 env) and DEVELOPMENT=true docker compose up (verified GF_DEFAULT_APP_MODE=development).

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 25, 2026

CLA assistant check
All committers have signed the CLA.

@grafana-plugins-platform-bot grafana-plugins-platform-bot Bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

Bug: Environment flag not respected when starting the Grafana server

1 participant